-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
522: Move update-tester tests to markdown files r=thatzopoulos a=thatzopoulos Changes to the update-tester: - Hardcoded tests are now read in from markdown files, similar to sql-doctester - Update-tester will now set all timezones to UTC before running sql scripts - Ability to set a min_toolkit_version that tests can run on Co-authored-by: Thomas Hatzopoulos <thomas@timescale.com>
- Loading branch information
Showing
6 changed files
with
1,042 additions
and
116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Original Update Tests | ||
|
||
|
||
|
||
```sql,creation,min-toolkit-version=1.4.0 | ||
SET TIME ZONE 'UTC'; | ||
CREATE TABLE test_data(ts timestamptz, val DOUBLE PRECISION); | ||
INSERT INTO test_data | ||
SELECT '2020-01-01 00:00:00+00'::timestamptz + i * '1 hour'::interval, | ||
100 + i % 100 | ||
FROM generate_series(0, 10000) i; | ||
CREATE MATERIALIZED VIEW regression_view AS | ||
SELECT | ||
counter_agg(ts, val) AS countagg, | ||
hyperloglog(1024, val) AS hll, | ||
time_weight('locf', ts, val) AS twa, | ||
uddsketch(100, 0.001, val) as udd, | ||
tdigest(100, val) as tdig, | ||
stats_agg(val) as stats | ||
FROM test_data; | ||
``` | ||
|
||
|
||
|
||
```sql,validation,min-toolkit-version=1.4.0 | ||
SELECT | ||
num_resets(countagg), | ||
distinct_count(hll), | ||
average(twa), | ||
approx_percentile(0.1, udd), | ||
approx_percentile(0.1, tdig), | ||
kurtosis(stats) | ||
FROM regression_view; | ||
``` | ||
|
||
```output | ||
num_resets | distinct_count | average | approx_percentile | approx_percentile | kurtosis | ||
------------+----------------+---------+--------------------+--------------------+-------------------- | ||
100 | 100 | 149.5 | 108.96220333142547 | 109.50489521100047 | 1.7995661075080858 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.