Skip to content

Commit

Permalink
chore: fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesGuthrie committed Nov 13, 2024
1 parent a36e670 commit 06a0d6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions docs/gauge_agg.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,32 @@ INSERT INTO gauge_test SELECT 3, '2020-01-03 UTC'::timestamptz + make_interval(d

### delta

```SQL
```SQL,ignore
SELECT toolkit_experimental.delta(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
delta
-------
-1991
```

### idelta_left

```SQL
```SQL,ignore
SELECT toolkit_experimental.idelta_left(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
idelta_left
-------------
1002
```

### idelta_right

```SQL
```SQL,ignore
SELECT toolkit_experimental.idelta_right(toolkit_experimental.gauge_agg(ts, val)) FROM gauge_test;
```
```output
```ignore
idelta_right
--------------
1010
Expand Down
8 changes: 4 additions & 4 deletions docs/tdigest.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ CALL refresh_continuous_aggregate('weekly_sketch', NULL, NULL);
</div>

Finally, a query is run over the aggregate to see various approximate percentiles from different weeks.
```SQL
```SQL,ignore
SELECT
week,
approx_percentile(0.01, digest) AS low,
Expand All @@ -146,7 +146,7 @@ SELECT
FROM weekly_sketch
ORDER BY week;
```
```output
```ignore
week | low | mid | high
-----------------------+-------------------+--------------------+--------------------
2019-12-30 00:00:00+00 | 783.2075197029583 | 1030.4505832620227 | 1276.7865808567146
Expand All @@ -158,14 +158,14 @@ ORDER BY week;
```

It is also possible to combine the weekly aggregates to run queries on the entire data:
```SQL
```SQL,ignore
SELECT
approx_percentile(0.01, combined.digest) AS low,
approx_percentile(0.5, combined.digest) AS mid,
approx_percentile(0.99, combined.digest) AS high
FROM (SELECT rollup(digest) AS digest FROM weekly_sketch) AS combined;
```
```output
```ignore
low | mid | high
------------------+--------------------+--------------------
746.7844638729881 | 1026.6100299252928 | 1294.5391132795592
Expand Down
2 changes: 1 addition & 1 deletion tools/sql-doctester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
bytecount = "0.6.2"
clap = { version = "3.2.15", features = ["wrap_help"] }
colored = "2.0.0"
postgres = "0.19.1"
postgres = "=0.19.7"
pulldown-cmark = "0.8.0"
rayon = "1.5"
uuid = { version = "0.8", features = ["v4"] }
Expand Down

0 comments on commit 06a0d6b

Please sign in to comment.