-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshot testing for AST pretty printing (#474)
- Loading branch information
Showing
22 changed files
with
1,126 additions
and
28 deletions.
There are no files selected for viewing
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
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
42 changes: 42 additions & 0 deletions
42
partiql-ast/tests/snapshots/pretty__having_limit_offset.snap
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,42 @@ | ||
--- | ||
source: partiql-ast/tests/pretty.rs | ||
expression: doc | ||
--- | ||
======================================================================================================================================================================================================== | ||
SELECT a FROM foo GROUP BY a HAVING a > 2 ORDER BY a LIMIT 1 OFFSET 1 | ||
======================================================================================================================================================================================================== | ||
|
||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ||
SELECT a FROM foo GROUP BY a HAVING (a > 2) ORDER BY a LIMIT 1 OFFSET 1 | ||
|
||
------------------------------------------------------------------------------------------------------------------------ | ||
SELECT a FROM foo GROUP BY a HAVING (a > 2) ORDER BY a LIMIT 1 OFFSET 1 | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT a FROM foo GROUP BY a HAVING (a > 2) ORDER BY a LIMIT 1 OFFSET 1 | ||
|
||
---------------------------------------- | ||
SELECT a FROM foo GROUP BY a | ||
HAVING (a > 2) ORDER BY a LIMIT 1 | ||
OFFSET 1 | ||
|
||
------------------------------ | ||
SELECT a FROM foo GROUP BY a | ||
HAVING (a > 2) ORDER BY a | ||
LIMIT 1 OFFSET 1 | ||
|
||
-------------------- | ||
SELECT a FROM foo | ||
GROUP BY a | ||
HAVING (a > 2) | ||
ORDER BY a LIMIT 1 | ||
OFFSET 1 | ||
|
||
---------- | ||
SELECT a | ||
FROM foo | ||
GROUP BY a | ||
HAVING (a > 2) | ||
ORDER BY a | ||
LIMIT 1 | ||
OFFSET 1 |
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,149 @@ | ||
--- | ||
source: partiql-ast/tests/pretty.rs | ||
expression: doc | ||
--- | ||
======================================================================================================================================================================================================== | ||
select foo,bar, baz,thud.*,grunt.a[*].b[2].*, count(1) as n from | ||
<< | ||
{ 'foo': 'foo', 'x': 9, 'y':5, z:-11 }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> group by foo order by n desc | ||
======================================================================================================================================================================================================== | ||
|
||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ||
SELECT foo, bar, baz, thud.*, grunt.a[*].b[2].*, count(1) AS n FROM << | ||
{ 'foo': 'foo', 'x': 9, 'y': 5, z: -11 }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo ORDER BY n DESC | ||
|
||
------------------------------------------------------------------------------------------------------------------------ | ||
SELECT foo, bar, baz, thud.*, grunt.a[*].b[2].*, count(1) AS n FROM << | ||
{ 'foo': 'foo', 'x': 9, 'y': 5, z: -11 }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo ORDER BY n DESC | ||
|
||
-------------------------------------------------------------------------------- | ||
SELECT foo, bar, baz, thud.*, grunt.a[*].b[2].*, count(1) AS n FROM << | ||
{ 'foo': 'foo', 'x': 9, 'y': 5, z: -11 }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo ORDER BY n DESC | ||
|
||
---------------------------------------- | ||
SELECT foo, bar, baz, thud.*, | ||
grunt.a[*].b[2].*, count(1) AS n | ||
FROM << | ||
{ | ||
'foo': 'foo', | ||
'x': 9, | ||
'y': 5, | ||
z: -11 | ||
}, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo ORDER BY n DESC | ||
|
||
------------------------------ | ||
SELECT foo, bar, baz, thud.*, | ||
grunt.a[*].b[2].*, | ||
count(1) AS n FROM << | ||
{ | ||
'foo': 'foo', | ||
'x': 9, | ||
'y': 5, | ||
z: -11 | ||
}, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'qux' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' }, | ||
{ 'foo': 'bar' }, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo | ||
ORDER BY n DESC | ||
|
||
-------------------- | ||
SELECT foo, bar, | ||
baz, thud.*, | ||
grunt.a[*].b[2].*, | ||
count(1) AS n | ||
FROM << | ||
{ | ||
'foo': 'foo', | ||
'x': 9, | ||
'y': 5, | ||
z: -11 | ||
}, | ||
{ 'foo': 'bar' | ||
}, | ||
{ 'foo': 'qux' | ||
}, | ||
{ 'foo': 'bar' | ||
}, | ||
{ 'foo': 'baz' | ||
}, | ||
{ 'foo': 'bar' | ||
}, | ||
{ 'foo': 'baz' } | ||
>> GROUP BY foo | ||
ORDER BY n DESC | ||
|
||
---------- | ||
SELECT foo, | ||
bar, | ||
baz, | ||
thud.*, | ||
grunt.a[*].b[2].*, | ||
count(1) AS n | ||
FROM << | ||
{ | ||
'foo': 'foo', | ||
'x': 9, | ||
'y': 5, | ||
z: -11 | ||
}, | ||
{ | ||
'foo': 'bar' | ||
}, | ||
{ | ||
'foo': 'qux' | ||
}, | ||
{ | ||
'foo': 'bar' | ||
}, | ||
{ | ||
'foo': 'baz' | ||
}, | ||
{ | ||
'foo': 'bar' | ||
}, | ||
{ | ||
'foo': 'baz' | ||
} | ||
>> | ||
GROUP BY | ||
foo | ||
ORDER BY n DESC |
Oops, something went wrong.
684fff3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PartiQL (rust) Benchmark
arith_agg-avg
771998
ns/iter (± 3660
)768879
ns/iter (± 44474
)1.00
arith_agg-avg_distinct
868193
ns/iter (± 32480
)852871
ns/iter (± 4563
)1.02
arith_agg-count
819127
ns/iter (± 13014
)818561
ns/iter (± 24924
)1.00
arith_agg-count_distinct
850385
ns/iter (± 12627
)846734
ns/iter (± 3407
)1.00
arith_agg-min
835124
ns/iter (± 7322
)832601
ns/iter (± 5272
)1.00
arith_agg-min_distinct
864818
ns/iter (± 5042
)859514
ns/iter (± 2662
)1.01
arith_agg-max
826288
ns/iter (± 9355
)827881
ns/iter (± 8412
)1.00
arith_agg-max_distinct
860400
ns/iter (± 3296
)860484
ns/iter (± 2589
)1.00
arith_agg-sum
822396
ns/iter (± 21825
)823950
ns/iter (± 4769
)1.00
arith_agg-sum_distinct
851443
ns/iter (± 4511
)850306
ns/iter (± 2494
)1.00
arith_agg-avg-count-min-max-sum
967909
ns/iter (± 18508
)960769
ns/iter (± 2950
)1.01
arith_agg-avg-count-min-max-sum-group_by
1261195
ns/iter (± 11052
)1270408
ns/iter (± 9721
)0.99
arith_agg-avg-count-min-max-sum-group_by-group_as
1872671
ns/iter (± 20081
)1880159
ns/iter (± 11463
)1.00
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct
1178677
ns/iter (± 10540
)1240402
ns/iter (± 20711
)0.95
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by
1589490
ns/iter (± 19655
)1581066
ns/iter (± 63203
)1.01
arith_agg-avg_distinct-count_distinct-min_distinct-max_distinct-sum_distinct-group_by-group_as
2165888
ns/iter (± 8946
)2187305
ns/iter (± 11171
)0.99
parse-1
4269
ns/iter (± 15
)4244
ns/iter (± 32
)1.01
parse-15
39638
ns/iter (± 150
)40550
ns/iter (± 352
)0.98
parse-30
77020
ns/iter (± 352
)78545
ns/iter (± 2822
)0.98
compile-1
4263
ns/iter (± 10
)4394
ns/iter (± 114
)0.97
compile-15
33192
ns/iter (± 197
)33209
ns/iter (± 207
)1.00
compile-30
67869
ns/iter (± 314
)68529
ns/iter (± 190
)0.99
plan-1
69565
ns/iter (± 234
)68549
ns/iter (± 487
)1.01
plan-15
1082605
ns/iter (± 19293
)1078118
ns/iter (± 10086
)1.00
plan-30
2170474
ns/iter (± 56024
)2156664
ns/iter (± 8444
)1.01
eval-1
12909400
ns/iter (± 104669
)13199986
ns/iter (± 178346
)0.98
eval-15
87331642
ns/iter (± 228299
)88062096
ns/iter (± 1058303
)0.99
eval-30
168169555
ns/iter (± 384409
)168580958
ns/iter (± 556192
)1.00
join
9942
ns/iter (± 344
)9884
ns/iter (± 93
)1.01
simple
2482
ns/iter (± 13
)2488
ns/iter (± 17
)1.00
simple-no
428
ns/iter (± 2
)427
ns/iter (± 11
)1.00
numbers
57
ns/iter (± 0
)57
ns/iter (± 0
)1
parse-simple
556
ns/iter (± 9
)565
ns/iter (± 7
)0.98
parse-ion
1736
ns/iter (± 29
)1750
ns/iter (± 9
)0.99
parse-group
5734
ns/iter (± 257
)5900
ns/iter (± 19
)0.97
parse-complex
14833
ns/iter (± 122
)14823
ns/iter (± 106
)1.00
parse-complex-fexpr
21781
ns/iter (± 130
)21985
ns/iter (± 877
)0.99
This comment was automatically generated by workflow using github-action-benchmark.