Skip to content

Commit 1825b9f

Browse files
authored
docs: fix approx_percentile_cont examples (#2090)
Signed-off-by: Dennis Zhuang <[email protected]>
1 parent 1e5186a commit 1825b9f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

docs/getting-started/quick-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ For example, you can use `approx_percentile_cont` to calculate the 95th percenti
185185

186186
```sql
187187
SELECT
188-
approx_percentile_cont(latency, 0.95) AS p95_latency,
188+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) AS p95_latency,
189189
host
190190
FROM grpc_latencies
191191
WHERE ts >= '2024-07-11 20:00:10'
@@ -231,7 +231,7 @@ For example, to calculate the p95 latency of requests using a 5-second window:
231231
SELECT
232232
ts,
233233
host,
234-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
234+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
235235
FROM
236236
grpc_latencies
237237
ALIGN '5s' FILL PREV;
@@ -266,7 +266,7 @@ WITH
266266
SELECT
267267
ts,
268268
host,
269-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
269+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
270270
FROM
271271
grpc_latencies
272272
ALIGN '5s' FILL PREV

docs/user-guide/query-data/cte.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ metrics AS (
7373
SELECT
7474
ts,
7575
host,
76-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
76+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
7777
FROM
7878
grpc_latencies
7979
ALIGN '5s' FILL PREV
@@ -123,7 +123,7 @@ Output:
123123
SELECT
124124
ts,
125125
host,
126-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
126+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
127127
FROM
128128
grpc_latencies
129129
ALIGN '5s' FILL PREV

i18n/zh/docusaurus-plugin-content-docs/current/getting-started/quick-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ SELECT *
183183

184184
```sql
185185
SELECT
186-
approx_percentile_cont(latency, 0.95) AS p95_latency,
186+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) AS p95_latency,
187187
host
188188
FROM grpc_latencies
189189
WHERE ts >= '2024-07-11 20:00:10'
@@ -229,7 +229,7 @@ SELECT * FROM app_logs WHERE lower(log_msg) @@ 'timeout' AND ts > '2024-07-11 20
229229
SELECT
230230
ts,
231231
host,
232-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
232+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
233233
FROM
234234
grpc_latencies
235235
ALIGN '5s' FILL PREV;
@@ -262,7 +262,7 @@ WITH
262262
SELECT
263263
ts,
264264
host,
265-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
265+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
266266
FROM
267267
grpc_latencies
268268
ALIGN '5s' FILL PREV

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/query-data/cte.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ metrics AS (
7373
SELECT
7474
ts,
7575
host,
76-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
76+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
7777
FROM
7878
grpc_latencies
7979
ALIGN '5s' FILL PREV
@@ -123,7 +123,7 @@ ORDER BY
123123
SELECT
124124
ts,
125125
host,
126-
approx_percentile_cont(latency, 0.95) RANGE '5s' AS p95_latency
126+
approx_percentile_cont(0.95) WITHIN GROUP (ORDER BY latency) RANGE '5s' AS p95_latency
127127
FROM
128128
grpc_latencies
129129
ALIGN '5s' FILL PREV

0 commit comments

Comments
 (0)