remove /play path from the url

This commit is contained in:
Lionel Palacin 2024-10-23 19:17:50 +01:00
parent 83dda28f59
commit a9f1159f9d
22 changed files with 63 additions and 63 deletions

View File

@ -18,7 +18,7 @@ SELECT library_name, license_type, license_path FROM system.licenses ORDER BY li
Note that the listed libraries are the ones located in the `contrib/` directory of the ClickHouse repository. Note that the listed libraries are the ones located in the `contrib/` directory of the ClickHouse repository.
Depending on the build options, some of the libraries may have not been compiled, and, as a result, their functionality may not be available at runtime. Depending on the build options, some of the libraries may have not been compiled, and, as a result, their functionality may not be available at runtime.
[Example](https://sql.clickhouse.com/play?query_id=478GCPU7LRTSZJBNY3EJT3) [Example](https://sql.clickhouse.com?query_id=478GCPU7LRTSZJBNY3EJT3)
## Adding and maintaining third-party libraries ## Adding and maintaining third-party libraries

View File

@ -453,4 +453,4 @@ ORDER BY yr,
mo; mo;
``` ```
The data is also available for interactive queries in the [Playground](https://sql.clickhouse.com/play), [example](https://sql.clickhouse.com/play?query_id=1MXMHASDLEQIP4P1D1STND). The data is also available for interactive queries in the [Playground](https://sql.clickhouse.com), [example](https://sql.clickhouse.com?query_id=1MXMHASDLEQIP4P1D1STND).

View File

@ -360,9 +360,9 @@ This screenshot shows cell tower locations with LTE, UMTS, and GSM radios. The
![Dashboard of cell towers by radio type in mcc 204](@site/docs/en/getting-started/example-datasets/images/superset-cell-tower-dashboard.png) ![Dashboard of cell towers by radio type in mcc 204](@site/docs/en/getting-started/example-datasets/images/superset-cell-tower-dashboard.png)
:::tip :::tip
The data is also available for interactive queries in the [Playground](https://sql.clickhouse.com/play). The data is also available for interactive queries in the [Playground](https://sql.clickhouse.com).
This [example](https://sql.clickhouse.com/play?query_id=UV8M4MAGS2PWAUOAYAAARM) will populate the username and even the query for you. This [example](https://sql.clickhouse.com?query_id=UV8M4MAGS2PWAUOAYAAARM) will populate the username and even the query for you.
Although you cannot create tables in the Playground, you can run all of the queries and even use Superset (adjust the host name and port number). Although you cannot create tables in the Playground, you can run all of the queries and even use Superset (adjust the host name and port number).
::: :::

View File

@ -244,13 +244,13 @@ FROM s3('https://datasets-documentation.s3.amazonaws.com/github/commits/clickhou
The tool suggests several queries via its help output. We have answered these in addition to some additional supplementary questions of interest. These queries are of approximately increasing complexity vs. the tool's arbitrary order. The tool suggests several queries via its help output. We have answered these in addition to some additional supplementary questions of interest. These queries are of approximately increasing complexity vs. the tool's arbitrary order.
This dataset is available in [play.clickhouse.com](https://sql.clickhouse.com/play?query_id=DCQPNPAIMAQXRLHYURLKVJ) in the `git_clickhouse` databases. We provide a link to this environment for all queries, adapting the database name as required. Note that play results may vary from the those presented here due to differences in time of data collection. This dataset is available in [play.clickhouse.com](https://sql.clickhouse.com?query_id=DCQPNPAIMAQXRLHYURLKVJ) in the `git_clickhouse` databases. We provide a link to this environment for all queries, adapting the database name as required. Note that play results may vary from the those presented here due to differences in time of data collection.
## History of a single file ## History of a single file
The simplest of queries. Here we look at all commit messages for the `StorageReplicatedMergeTree.cpp`. Since these are likely more interesting, we sort by the most recent messages first. The simplest of queries. Here we look at all commit messages for the `StorageReplicatedMergeTree.cpp`. Since these are likely more interesting, we sort by the most recent messages first.
[play](https://sql.clickhouse.com/play?query_id=COAZRFX2YFULDBXRQTCQ1S) [play](https://sql.clickhouse.com?query_id=COAZRFX2YFULDBXRQTCQ1S)
```sql ```sql
SELECT SELECT
@ -287,7 +287,7 @@ LIMIT 10
We can also review the line changes, excluding renames i.e. we won't show changes before a rename event when the file existed under a different name: We can also review the line changes, excluding renames i.e. we won't show changes before a rename event when the file existed under a different name:
[play](https://sql.clickhouse.com/play?query_id=AKS9SYLARFMZCHGAAQNEBN) [play](https://sql.clickhouse.com?query_id=AKS9SYLARFMZCHGAAQNEBN)
```sql ```sql
SELECT SELECT
@ -327,7 +327,7 @@ This is important for later analysis when we only want to consider the current f
**Note there appears to have been a broken commit history in relation to files under the `dbms`, `libs`, `tests/testflows/` directories during their renames. We also thus exclude these.** **Note there appears to have been a broken commit history in relation to files under the `dbms`, `libs`, `tests/testflows/` directories during their renames. We also thus exclude these.**
[play](https://sql.clickhouse.com/play?query_id=2HNFWPCFWEEY92WTAPMA7W) [play](https://sql.clickhouse.com?query_id=2HNFWPCFWEEY92WTAPMA7W)
```sql ```sql
SELECT path SELECT path
@ -369,7 +369,7 @@ LIMIT 10
Note that this allows for files to be renamed and then re-renamed to their original values. First we aggregate `old_path` for a list of deleted files as a result of renaming. We union this with the last operation for every `path`. Finally, we filter this list to those where the final event is not a `Delete`. Note that this allows for files to be renamed and then re-renamed to their original values. First we aggregate `old_path` for a list of deleted files as a result of renaming. We union this with the last operation for every `path`. Finally, we filter this list to those where the final event is not a `Delete`.
[play](https://sql.clickhouse.com/play?query_id=1OXCKMOH2JVMSHD3NS2WW6) [play](https://sql.clickhouse.com?query_id=1OXCKMOH2JVMSHD3NS2WW6)
```sql ```sql
SELECT uniq(path) SELECT uniq(path)
@ -419,7 +419,7 @@ The difference here is caused by a few factors:
- A rename can occur alongside other modifications to the file. These are listed as separate events in file_changes but with the same time. The `argMax` function has no way of distinguishing these - it picks the first value. The natural ordering of the inserts (the only means of knowing the correct order) is not maintained across the union so modified events can be selected. For example, below the `src/Functions/geometryFromColumn.h` file has several modifications before being renamed to `src/Functions/geometryConverters.h`. Our current solution may pick a Modify event as the latest change causing `src/Functions/geometryFromColumn.h` to be retained. - A rename can occur alongside other modifications to the file. These are listed as separate events in file_changes but with the same time. The `argMax` function has no way of distinguishing these - it picks the first value. The natural ordering of the inserts (the only means of knowing the correct order) is not maintained across the union so modified events can be selected. For example, below the `src/Functions/geometryFromColumn.h` file has several modifications before being renamed to `src/Functions/geometryConverters.h`. Our current solution may pick a Modify event as the latest change causing `src/Functions/geometryFromColumn.h` to be retained.
[play](https://sql.clickhouse.com/play?query_id=SCXWMR9GBMJ9UNZYQXQBFA) [play](https://sql.clickhouse.com?query_id=SCXWMR9GBMJ9UNZYQXQBFA)
```sql ```sql
SELECT SELECT
@ -454,7 +454,7 @@ These differences shouldn't meaningfully impact our analysis. **We welcome impro
Limiting to current files, we consider the number of modifications to be the sum of deletes and additions. Limiting to current files, we consider the number of modifications to be the sum of deletes and additions.
[play](https://sql.clickhouse.com/play?query_id=MHXPSBNPTDMJYR3OYSXVR7) [play](https://sql.clickhouse.com?query_id=MHXPSBNPTDMJYR3OYSXVR7)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -507,7 +507,7 @@ LIMIT 10
## What day of the week do commits usually occur? ## What day of the week do commits usually occur?
[play](https://sql.clickhouse.com/play?query_id=GED2STFSYJDRAA59H8RLIV) [play](https://sql.clickhouse.com?query_id=GED2STFSYJDRAA59H8RLIV)
```sql ```sql
SELECT SELECT
@ -534,7 +534,7 @@ This makes sense with some productivity drop-off on Fridays. Great to see people
This would produce a large query result that is unrealistic to show or visualize if unfiltered. We, therefore, allow a file or subdirectory to be filtered in the following example. Here we group by week using the `toStartOfWeek` function - adapt as required. This would produce a large query result that is unrealistic to show or visualize if unfiltered. We, therefore, allow a file or subdirectory to be filtered in the following example. Here we group by week using the `toStartOfWeek` function - adapt as required.
[play](https://sql.clickhouse.com/play?query_id=REZRXDVU7CAWT5WKNJSTNY) [play](https://sql.clickhouse.com?query_id=REZRXDVU7CAWT5WKNJSTNY)
```sql ```sql
SELECT SELECT
@ -578,7 +578,7 @@ This data visualizes well. Below we use Superset.
Limit to current files only. Limit to current files only.
[play](https://sql.clickhouse.com/play?query_id=CYQFNQNK9TAMPU2OZ8KG5Y) [play](https://sql.clickhouse.com?query_id=CYQFNQNK9TAMPU2OZ8KG5Y)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -633,7 +633,7 @@ LIMIT 10
Limited to current files only. Limited to current files only.
[play](https://sql.clickhouse.com/play?query_id=VWPBPGRZVGTHOCQYWNQZNT) [play](https://sql.clickhouse.com?query_id=VWPBPGRZVGTHOCQYWNQZNT)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -690,7 +690,7 @@ LIMIT 10
Limited to current files only. Limited to current files only.
[play](https://sql.clickhouse.com/play?query_id=VWPBPGRZVGTHOCQYWNQZNT) [play](https://sql.clickhouse.com?query_id=VWPBPGRZVGTHOCQYWNQZNT)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -750,7 +750,7 @@ Our core data structure, the Merge Tree, is obviously under constant evolution w
Do we write more docs at certain times of the month e.g., around release dates? We can use the `countIf` function to compute a simple ratio, visualizing the result using the `bar` function. Do we write more docs at certain times of the month e.g., around release dates? We can use the `countIf` function to compute a simple ratio, visualizing the result using the `bar` function.
[play](https://sql.clickhouse.com/play?query_id=BA4RZUXUHNQBH9YK7F2T9J) [play](https://sql.clickhouse.com?query_id=BA4RZUXUHNQBH9YK7F2T9J)
```sql ```sql
SELECT SELECT
@ -811,7 +811,7 @@ Maybe a little more near the end of the month, but overall we keep a good even d
We consider diversity here to be the number of unique files an author has contributed to. We consider diversity here to be the number of unique files an author has contributed to.
[play](https://sql.clickhouse.com/play?query_id=MT8WBABUKYBYSBA78W5TML) [play](https://sql.clickhouse.com?query_id=MT8WBABUKYBYSBA78W5TML)
```sql ```sql
SELECT SELECT
@ -841,7 +841,7 @@ LIMIT 10
Let's see who has the most diverse commits in their recent work. Rather than limit by date, we'll restrict to an author's last N commits (in this case, we've used 3 but feel free to modify): Let's see who has the most diverse commits in their recent work. Rather than limit by date, we'll restrict to an author's last N commits (in this case, we've used 3 but feel free to modify):
[play](https://sql.clickhouse.com/play?query_id=4Q3D67FWRIVWTY8EIDDE5U) [play](https://sql.clickhouse.com?query_id=4Q3D67FWRIVWTY8EIDDE5U)
```sql ```sql
SELECT SELECT
@ -888,7 +888,7 @@ LIMIT 10
Here we select our founder [Alexey Milovidov](https://github.com/alexey-milovidov) and limit our analysis to current files. Here we select our founder [Alexey Milovidov](https://github.com/alexey-milovidov) and limit our analysis to current files.
[play](https://sql.clickhouse.com/play?query_id=OKGZBACRHVGCRAGCZAJKMF) [play](https://sql.clickhouse.com?query_id=OKGZBACRHVGCRAGCZAJKMF)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -941,7 +941,7 @@ LIMIT 10
This makes sense because Alexey has been responsible for maintaining the Change log. But what if we use the base name of the file to identify his popular files - this allows for renames and should focus on code contributions. This makes sense because Alexey has been responsible for maintaining the Change log. But what if we use the base name of the file to identify his popular files - this allows for renames and should focus on code contributions.
[play](https://sql.clickhouse.com/play?query_id=P9PBDZGOSVTKXEXU73ZNAJ) [play](https://sql.clickhouse.com?query_id=P9PBDZGOSVTKXEXU73ZNAJ)
```sql ```sql
SELECT SELECT
@ -976,7 +976,7 @@ For this, we first need to identify the largest files. Estimating this via a ful
To estimate, assuming we restrict to current files, we sum line additions and subtract deletions. We can then compute a ratio of length to the number of authors. To estimate, assuming we restrict to current files, we sum line additions and subtract deletions. We can then compute a ratio of length to the number of authors.
[play](https://sql.clickhouse.com/play?query_id=PVSDOHZYUMRDDUZFEYJC7J) [play](https://sql.clickhouse.com?query_id=PVSDOHZYUMRDDUZFEYJC7J)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -1031,7 +1031,7 @@ LIMIT 10
Text dictionaries aren't maybe realistic, so lets restrict to code only via a file extension filter! Text dictionaries aren't maybe realistic, so lets restrict to code only via a file extension filter!
[play](https://sql.clickhouse.com/play?query_id=BZHGWUIZMPZZUHS5XRBK2M) [play](https://sql.clickhouse.com?query_id=BZHGWUIZMPZZUHS5XRBK2M)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -1085,7 +1085,7 @@ LIMIT 10
There is some recency bias in this - newer files have fewer opportunities for commits. What about if we restrict to files at least 1 yr old? There is some recency bias in this - newer files have fewer opportunities for commits. What about if we restrict to files at least 1 yr old?
[play](https://sql.clickhouse.com/play?query_id=RMHHZEDHFUCBGRQVQA2732) [play](https://sql.clickhouse.com?query_id=RMHHZEDHFUCBGRQVQA2732)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -1144,7 +1144,7 @@ LIMIT 10
We interpret this as the number of lines added and removed by the day of the week. In this case, we focus on the [Functions directory](https://github.com/ClickHouse/ClickHouse/tree/master/src/Functions) We interpret this as the number of lines added and removed by the day of the week. In this case, we focus on the [Functions directory](https://github.com/ClickHouse/ClickHouse/tree/master/src/Functions)
[play](https://sql.clickhouse.com/play?query_id=PF3KEMYG5CVLJGCFYQEGB1) [play](https://sql.clickhouse.com?query_id=PF3KEMYG5CVLJGCFYQEGB1)
```sql ```sql
SELECT SELECT
@ -1171,7 +1171,7 @@ GROUP BY toDayOfWeek(time) AS dayOfWeek
And by time of day, And by time of day,
[play](https://sql.clickhouse.com/play?query_id=Q4VDVKEGHHRBCUJHNCVTF1) [play](https://sql.clickhouse.com?query_id=Q4VDVKEGHHRBCUJHNCVTF1)
```sql ```sql
SELECT SELECT
@ -1215,7 +1215,7 @@ GROUP BY toHour(time) AS hourOfDay
This distribution makes sense given most of our development team is in Amsterdam. The `bar` functions helps us visualize these distributions: This distribution makes sense given most of our development team is in Amsterdam. The `bar` functions helps us visualize these distributions:
[play](https://sql.clickhouse.com/play?query_id=9AZ8CENV8N91YGW7T6IB68) [play](https://sql.clickhouse.com?query_id=9AZ8CENV8N91YGW7T6IB68)
```sql ```sql
SELECT SELECT
@ -1269,7 +1269,7 @@ FROM
The `sign = -1` indicates a code deletion. We exclude punctuation and the insertion of empty lines. The `sign = -1` indicates a code deletion. We exclude punctuation and the insertion of empty lines.
[play](https://sql.clickhouse.com/play?query_id=448O8GWAHY3EM6ZZ7AGLAM) [play](https://sql.clickhouse.com?query_id=448O8GWAHY3EM6ZZ7AGLAM)
```sql ```sql
SELECT SELECT
@ -1325,7 +1325,7 @@ Alexey clearly likes removing other peoples code. Lets exclude him for a more ba
If we consider by just number of commits: If we consider by just number of commits:
[play](https://sql.clickhouse.com/play?query_id=WXPKFJCAHOKYKEVTWNFVCY) [play](https://sql.clickhouse.com?query_id=WXPKFJCAHOKYKEVTWNFVCY)
```sql ```sql
SELECT SELECT
@ -1356,7 +1356,7 @@ LIMIT 1 BY day_of_week
OK, some possible advantages here to the longest contributor - our founder Alexey. Lets limit our analysis to the last year. OK, some possible advantages here to the longest contributor - our founder Alexey. Lets limit our analysis to the last year.
[play](https://sql.clickhouse.com/play?query_id=8YRJGHFTNJAWJ96XCJKKEH) [play](https://sql.clickhouse.com?query_id=8YRJGHFTNJAWJ96XCJKKEH)
```sql ```sql
SELECT SELECT
@ -1390,7 +1390,7 @@ This is still a little simple and doesn't reflect people's work.
A better metric might be who is the top contributor each day as a fraction of the total work performed in the last year. Note that we treat the deletion and adding code equally. A better metric might be who is the top contributor each day as a fraction of the total work performed in the last year. Note that we treat the deletion and adding code equally.
[play](https://sql.clickhouse.com/play?query_id=VQF4KMRDSUEXGS1JFVDJHV) [play](https://sql.clickhouse.com?query_id=VQF4KMRDSUEXGS1JFVDJHV)
```sql ```sql
SELECT SELECT
@ -1440,7 +1440,7 @@ INNER JOIN
We limit the analysis to the current files. For brevity, we restrict the results to a depth of 2 with 5 files per root folder. Adjust as required. We limit the analysis to the current files. For brevity, we restrict the results to a depth of 2 with 5 files per root folder. Adjust as required.
[play](https://sql.clickhouse.com/play?query_id=6YWAUQYPZINZDJGBEZBNWG) [play](https://sql.clickhouse.com?query_id=6YWAUQYPZINZDJGBEZBNWG)
```sql ```sql
WITH current_files AS WITH current_files AS
@ -1523,7 +1523,7 @@ LIMIT 5 BY root
For this question, we need the number of lines written by an author divided by the total number of lines they have had removed by another contributor. For this question, we need the number of lines written by an author divided by the total number of lines they have had removed by another contributor.
[play](https://sql.clickhouse.com/play?query_id=T4DTWTB36WFSEYAZLMGRNF) [play](https://sql.clickhouse.com?query_id=T4DTWTB36WFSEYAZLMGRNF)
```sql ```sql
SELECT SELECT
@ -1627,7 +1627,7 @@ This doesn't capture the notion of a "re-write" however, where a large portion o
The query is limited to the current files only. We list all file changes by grouping by `path` and `commit_hash`, returning the number of lines added and removed. Using a window function, we estimate the file's total size at any moment in time by performing a cumulative sum and estimating the impact of any change on file size as `lines added - lines removed`. Using this statistic, we can calculate the percentage of the file that has been added or removed for each change. Finally, we count the number of file changes that constitute a rewrite per file i.e. `(percent_add >= 0.5) AND (percent_delete >= 0.5) AND current_size > 50`. Note we require files to be more than 50 lines to avoid early contributions to a file being counted as a rewrite. This also avoids a bias to very small files, which may be more likely to be rewritten. The query is limited to the current files only. We list all file changes by grouping by `path` and `commit_hash`, returning the number of lines added and removed. Using a window function, we estimate the file's total size at any moment in time by performing a cumulative sum and estimating the impact of any change on file size as `lines added - lines removed`. Using this statistic, we can calculate the percentage of the file that has been added or removed for each change. Finally, we count the number of file changes that constitute a rewrite per file i.e. `(percent_add >= 0.5) AND (percent_delete >= 0.5) AND current_size > 50`. Note we require files to be more than 50 lines to avoid early contributions to a file being counted as a rewrite. This also avoids a bias to very small files, which may be more likely to be rewritten.
[play](https://sql.clickhouse.com/play?query_id=5PL1QLNSH6QQTR8H9HINNP) [play](https://sql.clickhouse.com?query_id=5PL1QLNSH6QQTR8H9HINNP)
```sql ```sql
WITH WITH
@ -1719,7 +1719,7 @@ We query for lines added, joining this with the lines removed - filtering to cas
Finally, we aggregate across this dataset to compute the average number of days lines stay in the repository by the day of the week. Finally, we aggregate across this dataset to compute the average number of days lines stay in the repository by the day of the week.
[play](https://sql.clickhouse.com/play?query_id=GVF23LEZTNZI22BT8LZBBE) [play](https://sql.clickhouse.com?query_id=GVF23LEZTNZI22BT8LZBBE)
```sql ```sql
SELECT SELECT
@ -1778,7 +1778,7 @@ GROUP BY dayOfWeek(added_day) AS day_of_week_added
This query uses the same principle as [What weekday does the code have the highest chance to stay in the repository](#what-weekday-does-the-code-have-the-highest-chance-to-stay-in-the-repository) - by aiming to uniquely identify a line of code using the path and line contents. This query uses the same principle as [What weekday does the code have the highest chance to stay in the repository](#what-weekday-does-the-code-have-the-highest-chance-to-stay-in-the-repository) - by aiming to uniquely identify a line of code using the path and line contents.
This allows us to identify the time between when a line was added and removed. We filter to current files and code only, however, and average the time for each file across lines. This allows us to identify the time between when a line was added and removed. We filter to current files and code only, however, and average the time for each file across lines.
[play](https://sql.clickhouse.com/play?query_id=3CYYT7HEHWRFHVCM9JCKSU) [play](https://sql.clickhouse.com?query_id=3CYYT7HEHWRFHVCM9JCKSU)
```sql ```sql
WITH WITH
@ -1869,7 +1869,7 @@ There are a few ways we can address this question. Focusing on the code to test
Note we limit to users with more than 20 changes to focus on regular committers and avoid a bias to one-off contributions. Note we limit to users with more than 20 changes to focus on regular committers and avoid a bias to one-off contributions.
[play](https://sql.clickhouse.com/play?query_id=JGKZSEQDPDTDKZXD3ZCGLE) [play](https://sql.clickhouse.com?query_id=JGKZSEQDPDTDKZXD3ZCGLE)
```sql ```sql
SELECT SELECT
@ -1911,7 +1911,7 @@ LIMIT 20
We can plot this distribution as a histogram. We can plot this distribution as a histogram.
[play](https://sql.clickhouse.com/play?query_id=S5AJIIRGSUAY1JXEVHQDAK) [play](https://sql.clickhouse.com?query_id=S5AJIIRGSUAY1JXEVHQDAK)
```sql ```sql
WITH ( WITH (
@ -1954,7 +1954,7 @@ Most contributors write more code than tests, as you'd expect.
What about who adds the most comments when contributing code? What about who adds the most comments when contributing code?
[play](https://sql.clickhouse.com/play?query_id=EXPHDIURBTOXXOK1TGNNYD) [play](https://sql.clickhouse.com?query_id=EXPHDIURBTOXXOK1TGNNYD)
```sql ```sql
SELECT SELECT
@ -2038,7 +2038,7 @@ To compute this, we first work out each author's comments ratio over time - simi
After calculating the average by-week offset across all authors, we sample these results by selecting every 10th week. After calculating the average by-week offset across all authors, we sample these results by selecting every 10th week.
[play](https://sql.clickhouse.com/play?query_id=SBHEWR8XC4PRHY13HPPKCN) [play](https://sql.clickhouse.com?query_id=SBHEWR8XC4PRHY13HPPKCN)
```sql ```sql
WITH author_ratios_by_offset AS WITH author_ratios_by_offset AS
@ -2116,7 +2116,7 @@ Encouragingly, our comment % is pretty constant and doesn't degrade the longer a
We can use the same principle as [List files that were rewritten most number of time or by most of authors](#list-files-that-were-rewritten-most-number-of-time-or-by-most-of-authors) to identify rewrites but consider all files. A window function is used to compute the time between rewrites for each file. From this, we can calculate an average and median across all files. We can use the same principle as [List files that were rewritten most number of time or by most of authors](#list-files-that-were-rewritten-most-number-of-time-or-by-most-of-authors) to identify rewrites but consider all files. A window function is used to compute the time between rewrites for each file. From this, we can calculate an average and median across all files.
[play](https://sql.clickhouse.com/play?query_id=WSHUEPJP9TNJUH7QITWWOR) [play](https://sql.clickhouse.com?query_id=WSHUEPJP9TNJUH7QITWWOR)
```sql ```sql
WITH WITH
@ -2176,7 +2176,7 @@ FROM rewrites
Similar to [What is the average time before code will be rewritten and the median (half-life of code decay)?](#what-is-the-average-time-before-code-will-be-rewritten-and-the-median-half-life-of-code-decay) and [List files that were rewritten most number of time or by most of authors](#list-files-that-were-rewritten-most-number-of-time-or-by-most-of-authors), except we aggregate by day of week. Adjust as required e.g. month of year. Similar to [What is the average time before code will be rewritten and the median (half-life of code decay)?](#what-is-the-average-time-before-code-will-be-rewritten-and-the-median-half-life-of-code-decay) and [List files that were rewritten most number of time or by most of authors](#list-files-that-were-rewritten-most-number-of-time-or-by-most-of-authors), except we aggregate by day of week. Adjust as required e.g. month of year.
[play](https://sql.clickhouse.com/play?query_id=8PQNWEWHAJTGN6FTX59KH2) [play](https://sql.clickhouse.com?query_id=8PQNWEWHAJTGN6FTX59KH2)
```sql ```sql
WITH WITH
@ -2240,7 +2240,7 @@ GROUP BY dayOfWeek
We define "sticky" as how long does an author's code stay before its rewritten. Similar to the previous question [What is the average time before code will be rewritten and the median (half-life of code decay)?](#what-is-the-average-time-before-code-will-be-rewritten-and-the-median-half-life-of-code-decay) - using the same metric for rewrites i.e. 50% additions and 50% deletions to the file. We compute the average rewrite time per author and only consider contributors with more than two files. We define "sticky" as how long does an author's code stay before its rewritten. Similar to the previous question [What is the average time before code will be rewritten and the median (half-life of code decay)?](#what-is-the-average-time-before-code-will-be-rewritten-and-the-median-half-life-of-code-decay) - using the same metric for rewrites i.e. 50% additions and 50% deletions to the file. We compute the average rewrite time per author and only consider contributors with more than two files.
[play](https://sql.clickhouse.com/play?query_id=BKHLVVWN5SET1VTIFQ8JVK) [play](https://sql.clickhouse.com?query_id=BKHLVVWN5SET1VTIFQ8JVK)
```sql ```sql
WITH WITH
@ -2319,7 +2319,7 @@ This query first requires us to calculate the days when an author has committed.
Our subsequent array functions compute each author's longest sequence of consecutive ones. First, the `groupArray` function is used to collate all `consecutive_day` values for an author. This array of 1s and 0s, is then split on 0 values into subarrays. Finally, we calculate the longest subarray. Our subsequent array functions compute each author's longest sequence of consecutive ones. First, the `groupArray` function is used to collate all `consecutive_day` values for an author. This array of 1s and 0s, is then split on 0 values into subarrays. Finally, we calculate the longest subarray.
[play](https://sql.clickhouse.com/play?query_id=S3E64UYCAMDAYJRSXINVFR) [play](https://sql.clickhouse.com?query_id=S3E64UYCAMDAYJRSXINVFR)
```sql ```sql
WITH commit_days AS WITH commit_days AS
@ -2372,7 +2372,7 @@ LIMIT 10
Files can be renamed. When this occurs, we get a rename event, where the `path` column is set to the new path of the file and the `old_path` represents the previous location e.g. Files can be renamed. When this occurs, we get a rename event, where the `path` column is set to the new path of the file and the `old_path` represents the previous location e.g.
[play](https://sql.clickhouse.com/play?query_id=AKTW3Z8JZAPQ4H9BH2ZFRX) [play](https://sql.clickhouse.com?query_id=AKTW3Z8JZAPQ4H9BH2ZFRX)
```sql ```sql
SELECT SELECT

View File

@ -354,4 +354,4 @@ At least they have caviar with vodka. Very nice.
## Online Playground {#playground} ## Online Playground {#playground}
The data is uploaded to ClickHouse Playground, [example](https://sql.clickhouse.com/play?query_id=KB5KQJJFNBKHE5GBUJCP1B). The data is uploaded to ClickHouse Playground, [example](https://sql.clickhouse.com?query_id=KB5KQJJFNBKHE5GBUJCP1B).

View File

@ -386,7 +386,7 @@ ORDER BY c DESC
LIMIT 10; LIMIT 10;
``` ```
You can also play with the data in Playground, [example](https://sql.clickhouse.com/play?query_id=M4FSVBVMSHY98NKCQP8N4K). You can also play with the data in Playground, [example](https://sql.clickhouse.com?query_id=M4FSVBVMSHY98NKCQP8N4K).
This performance test was created by Vadim Tkachenko. See: This performance test was created by Vadim Tkachenko. See:

View File

@ -417,4 +417,4 @@ Result:
### Online Playground {#playground} ### Online Playground {#playground}
You can test other queries to this data set using the interactive resource [Online Playground](https://sql.clickhouse.com/play). For example, [like this](https://sql.clickhouse.com/play?query_id=BIPDVQNIGVEZFQYFEFQB7O). However, please note that you cannot create temporary tables here. You can test other queries to this data set using the interactive resource [Online Playground](https://sql.clickhouse.com). For example, [like this](https://sql.clickhouse.com?query_id=BIPDVQNIGVEZFQYFEFQB7O). However, please note that you cannot create temporary tables here.

View File

@ -335,4 +335,4 @@ Result:
### Online Playground ### Online Playground
The dataset is also available in the [Online Playground](https://sql.clickhouse.com/play?query_id=HQXNQZE26Z1QWYP9KC76ML). The dataset is also available in the [Online Playground](https://sql.clickhouse.com?query_id=HQXNQZE26Z1QWYP9KC76ML).

View File

@ -447,4 +447,4 @@ With projection: 100 rows in set. Elapsed: 0.336 sec. Processed 17.32 thousand r
### Test it in the Playground {#playground} ### Test it in the Playground {#playground}
The dataset is also available in the [Online Playground](https://sql.clickhouse.com/play?query_id=TRCWH5ZETY4SEEK8ISCCAX). The dataset is also available in the [Online Playground](https://sql.clickhouse.com?query_id=TRCWH5ZETY4SEEK8ISCCAX).

View File

@ -8,7 +8,7 @@ slug: /en/getting-started/playground
# ClickHouse Playground # ClickHouse Playground
[ClickHouse Playground](https://sql.clickhouse.com/play) allows people to experiment with ClickHouse by running queries instantly, without setting up their server or cluster. [ClickHouse Playground](https://sql.clickhouse.com) allows people to experiment with ClickHouse by running queries instantly, without setting up their server or cluster.
Several example datasets are available in Playground. Several example datasets are available in Playground.
You can make queries to Playground using any HTTP client, for example [curl](https://curl.haxx.se) or [wget](https://www.gnu.org/software/wget/), or set up a connection using [JDBC](../interfaces/jdbc.md) or [ODBC](../interfaces/odbc.md) drivers. More information about software products that support ClickHouse is available [here](../integrations/index.mdx). You can make queries to Playground using any HTTP client, for example [curl](https://curl.haxx.se) or [wget](https://www.gnu.org/software/wget/), or set up a connection using [JDBC](../interfaces/jdbc.md) or [ODBC](../interfaces/odbc.md) drivers. More information about software products that support ClickHouse is available [here](../integrations/index.mdx).

View File

@ -93,7 +93,7 @@ sidebar_label: "Используемые сторонние библиотеки
SELECT library_name, license_type, license_path FROM system.licenses ORDER BY library_name COLLATE 'en'; SELECT library_name, license_type, license_path FROM system.licenses ORDER BY library_name COLLATE 'en';
``` ```
[Пример](https://sql.clickhouse.com/play?query_id=478GCPU7LRTSZJBNY3EJT3) [Пример](https://sql.clickhouse.com?query_id=478GCPU7LRTSZJBNY3EJT3)
## Рекомендации по добавлению сторонних библиотек и поддержанию в них пользовательских изменений {#adding-third-party-libraries} ## Рекомендации по добавлению сторонних библиотек и поддержанию в них пользовательских изменений {#adding-third-party-libraries}

View File

@ -412,4 +412,4 @@ ORDER BY yr,
mo; mo;
``` ```
Данные также доступны для работы с интерактивными запросами через [Playground](https://sql.clickhouse.com/play), [пример](https://sql.clickhouse.com/play?query_id=1MXMHASDLEQIP4P1D1STND). Данные также доступны для работы с интерактивными запросами через [Playground](https://sql.clickhouse.com), [пример](https://sql.clickhouse.com?query_id=1MXMHASDLEQIP4P1D1STND).

View File

@ -126,4 +126,4 @@ SELECT count() FROM cell_towers WHERE pointInPolygon((lon, lat), (SELECT * FROM
1 rows in set. Elapsed: 0.067 sec. Processed 43.28 million rows, 692.42 MB (645.83 million rows/s., 10.33 GB/s.) 1 rows in set. Elapsed: 0.067 sec. Processed 43.28 million rows, 692.42 MB (645.83 million rows/s., 10.33 GB/s.)
``` ```
Вы можете протестировать другие запросы с помощью интерактивного ресурса [Playground](https://sql.clickhouse.com/play). Например, [вот так](https://sql.clickhouse.com/play?query_id=UV8M4MAGS2PWAUOAYAAARM). Однако, обратите внимание, что здесь нельзя создавать временные таблицы. Вы можете протестировать другие запросы с помощью интерактивного ресурса [Playground](https://sql.clickhouse.com). Например, [вот так](https://sql.clickhouse.com?query_id=UV8M4MAGS2PWAUOAYAAARM). Однако, обратите внимание, что здесь нельзя создавать временные таблицы.

View File

@ -338,4 +338,4 @@ WHERE title = 'Chocolate-Strawberry-Orange Wedding Cake';
### Online Playground ### Online Playground
Этот набор данных доступен в [Online Playground](https://sql.clickhouse.com/play?query_id=HQXNQZE26Z1QWYP9KC76ML). Этот набор данных доступен в [Online Playground](https://sql.clickhouse.com?query_id=HQXNQZE26Z1QWYP9KC76ML).

View File

@ -6,7 +6,7 @@ sidebar_label: Playground
# ClickHouse Playground {#clickhouse-playground} # ClickHouse Playground {#clickhouse-playground}
[ClickHouse Playground](https://sql.clickhouse.com/play) позволяет пользователям экспериментировать с ClickHouse, выполняя запросы мгновенно, без необходимости настройки сервера или кластера. [ClickHouse Playground](https://sql.clickhouse.com) позволяет пользователям экспериментировать с ClickHouse, выполняя запросы мгновенно, без необходимости настройки сервера или кластера.
В Playground доступны несколько примеров наборов данных. В Playground доступны несколько примеров наборов данных.
Вы можете выполнять запросы к Playground, используя любой HTTP-клиент, например [curl](https://curl.haxx.se) или [wget](https://www.gnu.org/software/wget/), или настроить соединение, используя драйверы [JDBC](../interfaces/jdbc.md) или [ODBC](../interfaces/odbc.md). Дополнительную информацию о программных продуктах, поддерживающих ClickHouse, можно найти [здесь](../interfaces/index.md). Вы можете выполнять запросы к Playground, используя любой HTTP-клиент, например [curl](https://curl.haxx.se) или [wget](https://www.gnu.org/software/wget/), или настроить соединение, используя драйверы [JDBC](../interfaces/jdbc.md) или [ODBC](../interfaces/odbc.md). Дополнительную информацию о программных продуктах, поддерживающих ClickHouse, можно найти [здесь](../interfaces/index.md).

View File

@ -457,4 +457,4 @@ ORDER BY yr,
mo; mo;
``` ```
此数据集可在 [Playground](https://sql.clickhouse.com/play) 中进行交互式的请求, [example](https://sql.clickhouse.com/play?query_id=1MXMHASDLEQIP4P1D1STND). 此数据集可在 [Playground](https://sql.clickhouse.com) 中进行交互式的请求, [example](https://sql.clickhouse.com?query_id=1MXMHASDLEQIP4P1D1STND).

View File

@ -228,5 +228,5 @@ WHERE pointInPolygon((lon, lat), (SELECT * FROM moscow))
1 rows in set. Elapsed: 0.067 sec. Processed 43.28 million rows, 692.42 MB (645.83 million rows/s., 10.33 GB/s.) 1 rows in set. Elapsed: 0.067 sec. Processed 43.28 million rows, 692.42 MB (645.83 million rows/s., 10.33 GB/s.)
``` ```
虽然不能创建临时表,但此数据集仍可在 [Playground](https://sql.clickhouse.com/play) 中进行交互式的请求, [example](https://sql.clickhouse.com/play?query_id=UV8M4MAGS2PWAUOAYAAARM). 虽然不能创建临时表,但此数据集仍可在 [Playground](https://sql.clickhouse.com) 中进行交互式的请求, [example](https://sql.clickhouse.com?query_id=UV8M4MAGS2PWAUOAYAAARM).

View File

@ -349,4 +349,4 @@ ORDER BY d ASC;
## 在线 Playground{#playground} ## 在线 Playground{#playground}
此数据集已经上传到了 ClickHouse Playground 中,[example](https://sql.clickhouse.com/play?query_id=KB5KQJJFNBKHE5GBUJCP1B)。 此数据集已经上传到了 ClickHouse Playground 中,[example](https://sql.clickhouse.com?query_id=KB5KQJJFNBKHE5GBUJCP1B)。

View File

@ -413,4 +413,4 @@ ORDER BY k ASC;
### 在线 Playground {#playground} ### 在线 Playground {#playground}
你可以使用交互式资源 [Online Playground](https://sql.clickhouse.com/play) 来尝试对此数据集的其他查询。 例如, [执行这个查询](https://sql.clickhouse.com/play?query_id=BIPDVQNIGVEZFQYFEFQB7O). 但是,请注意无法在 Playground 中创建临时表。 你可以使用交互式资源 [Online Playground](https://sql.clickhouse.com) 来尝试对此数据集的其他查询。 例如, [执行这个查询](https://sql.clickhouse.com?query_id=BIPDVQNIGVEZFQYFEFQB7O). 但是,请注意无法在 Playground 中创建临时表。

View File

@ -334,6 +334,6 @@ WHERE title = 'Chocolate-Strawberry-Orange Wedding Cake'
### 在线 Playground ### 在线 Playground
此数据集也可在 [在线 Playground](https://sql.clickhouse.com/play?query_id=HQXNQZE26Z1QWYP9KC76ML) 中体验。 此数据集也可在 [在线 Playground](https://sql.clickhouse.com?query_id=HQXNQZE26Z1QWYP9KC76ML) 中体验。
[原文链接](https://clickhouse.com/docs/en/getting-started/example-datasets/recipes/) [原文链接](https://clickhouse.com/docs/en/getting-started/example-datasets/recipes/)

View File

@ -447,4 +447,4 @@ With projection: 100 rows in set. Elapsed: 0.336 sec. Processed 17.32 thousand r
### 在 Playground 上测试{#playground} ### 在 Playground 上测试{#playground}
也可以在 [Online Playground](https://sql.clickhouse.com/play?query_id=TRCWH5ZETY4SEEK8ISCCAX) 上找到此数据集。 也可以在 [Online Playground](https://sql.clickhouse.com?query_id=TRCWH5ZETY4SEEK8ISCCAX) 上找到此数据集。

View File

@ -6,7 +6,7 @@ sidebar_label: 体验平台
# ClickHouse Playground {#clickhouse-playground} # ClickHouse Playground {#clickhouse-playground}
无需搭建服务或集群,[ClickHouse Playground](https://sql.clickhouse.com/play)允许人们通过执行查询语句立即体验ClickHouse在Playground中我们提供了一些示例数据集。 无需搭建服务或集群,[ClickHouse Playground](https://sql.clickhouse.com)允许人们通过执行查询语句立即体验ClickHouse在Playground中我们提供了一些示例数据集。
你可以使用任意HTTP客户端向Playground提交查询语句比如[curl](https://curl.haxx.se)或者[wget](https://www.gnu.org/software/wget/),也可以通过[JDBC](../interfaces/jdbc.md)或者[ODBC](../interfaces/odbc.md)驱动建立连接,更多信息详见[客户端](../interfaces/index.md)。 你可以使用任意HTTP客户端向Playground提交查询语句比如[curl](https://curl.haxx.se)或者[wget](https://www.gnu.org/software/wget/),也可以通过[JDBC](../interfaces/jdbc.md)或者[ODBC](../interfaces/odbc.md)驱动建立连接,更多信息详见[客户端](../interfaces/index.md)。