Skip to content

Commit 3485db1

Browse files
committed
Add AST JSON golden files for additional test cases
These ast.json files provide regression testing for parser output, ensuring AST structure remains consistent across changes.
1 parent 8fb7119 commit 3485db1

75 files changed

Lines changed: 4462 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"selects": [
3+
{
4+
"columns": [
5+
{
6+
"name": "medianTiming",
7+
"arguments": [
8+
{
9+
"parts": [
10+
"t"
11+
]
12+
}
13+
]
14+
},
15+
{
16+
"name": "medianTimingWeighted",
17+
"arguments": [
18+
{
19+
"parts": [
20+
"t"
21+
]
22+
},
23+
{
24+
"parts": [
25+
"w"
26+
]
27+
}
28+
]
29+
}
30+
],
31+
"from": {
32+
"tables": [
33+
{
34+
"table": {
35+
"table": {
36+
"query": {
37+
"selects": [
38+
{
39+
"columns": [
40+
{
41+
"parts": [
42+
"number"
43+
],
44+
"alias": "t"
45+
},
46+
{
47+
"expr": {
48+
"condition": {
49+
"left": {
50+
"parts": [
51+
"number"
52+
]
53+
},
54+
"op": "=",
55+
"right": {
56+
"type": "Integer",
57+
"value": 77
58+
}
59+
},
60+
"then": {
61+
"type": "Integer",
62+
"value": 10
63+
},
64+
"else": {
65+
"type": "Integer",
66+
"value": 1
67+
}
68+
},
69+
"alias": "w"
70+
}
71+
],
72+
"from": {
73+
"tables": [
74+
{
75+
"table": {
76+
"table": {
77+
"database": "system",
78+
"table": "numbers"
79+
}
80+
}
81+
}
82+
]
83+
},
84+
"limit": {
85+
"type": "Integer",
86+
"value": 100
87+
}
88+
}
89+
]
90+
}
91+
}
92+
}
93+
}
94+
]
95+
}
96+
}
97+
]
98+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"pairs": [
3+
{
4+
"from_database": "test",
5+
"from_table": "hits",
6+
"to_database": "test",
7+
"to_table": "visits_tmp"
8+
},
9+
{
10+
"from_database": "test",
11+
"from_table": "visits",
12+
"to_database": "test",
13+
"to_table": "hits"
14+
},
15+
{
16+
"from_database": "test",
17+
"from_table": "visits_tmp",
18+
"to_database": "test",
19+
"to_table": "visits"
20+
}
21+
],
22+
"from": "test.hits",
23+
"to": "test.visits_tmp"
24+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"if_exists": true,
3+
"database": "test",
4+
"table": "hits_1m",
5+
"tables": [
6+
{
7+
"database": "test",
8+
"table": "hits_1m"
9+
}
10+
]
11+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"selects": [
3+
{
4+
"columns": [
5+
{
6+
"name": "toUInt8",
7+
"arguments": [
8+
{
9+
"parts": [
10+
"number"
11+
]
12+
}
13+
],
14+
"alias": "x"
15+
},
16+
{
17+
"name": "round",
18+
"arguments": [
19+
{
20+
"parts": [
21+
"x"
22+
]
23+
}
24+
]
25+
},
26+
{
27+
"name": "roundBankers",
28+
"arguments": [
29+
{
30+
"parts": [
31+
"x"
32+
]
33+
}
34+
]
35+
},
36+
{
37+
"name": "floor",
38+
"arguments": [
39+
{
40+
"parts": [
41+
"x"
42+
]
43+
}
44+
]
45+
},
46+
{
47+
"name": "ceil",
48+
"arguments": [
49+
{
50+
"parts": [
51+
"x"
52+
]
53+
}
54+
]
55+
},
56+
{
57+
"name": "trunc",
58+
"arguments": [
59+
{
60+
"parts": [
61+
"x"
62+
]
63+
}
64+
]
65+
}
66+
],
67+
"from": {
68+
"tables": [
69+
{
70+
"table": {
71+
"table": {
72+
"database": "system",
73+
"table": "numbers"
74+
}
75+
}
76+
}
77+
]
78+
},
79+
"limit": {
80+
"type": "Integer",
81+
"value": 20
82+
}
83+
}
84+
]
85+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"selects": [
3+
{
4+
"columns": [
5+
{
6+
"expr": {
7+
"condition": {
8+
"left": {
9+
"parts": [
10+
"number"
11+
]
12+
},
13+
"op": "%",
14+
"right": {
15+
"type": "Integer",
16+
"value": 2
17+
}
18+
},
19+
"then": {
20+
"type": "Array",
21+
"value": [
22+
{
23+
"type": "Integer",
24+
"value": 1
25+
},
26+
{
27+
"type": "Integer",
28+
"value": 2
29+
}
30+
]
31+
},
32+
"else": {
33+
"type": "Array",
34+
"value": [
35+
{
36+
"type": "Integer",
37+
"value": 3
38+
},
39+
{
40+
"type": "Integer",
41+
"value": 4
42+
},
43+
{
44+
"type": "Integer",
45+
"value": 5
46+
}
47+
]
48+
}
49+
},
50+
"alias": "res"
51+
}
52+
],
53+
"from": {
54+
"tables": [
55+
{
56+
"table": {
57+
"table": {
58+
"database": "system",
59+
"table": "numbers"
60+
}
61+
}
62+
}
63+
]
64+
},
65+
"limit": {
66+
"type": "Integer",
67+
"value": 10
68+
},
69+
"format": {
70+
"parts": [
71+
"TabSeparatedWithNamesAndTypes"
72+
]
73+
}
74+
}
75+
]
76+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"selects": [
3+
{
4+
"columns": [
5+
{
6+
"name": "range",
7+
"arguments": [
8+
{
9+
"parts": [
10+
"x"
11+
]
12+
}
13+
],
14+
"alias": "k"
15+
},
16+
{
17+
"name": "count"
18+
}
19+
],
20+
"from": {
21+
"tables": [
22+
{
23+
"table": {
24+
"table": {
25+
"query": {
26+
"selects": [
27+
{
28+
"columns": [
29+
{
30+
"expr": {
31+
"condition": {
32+
"left": {
33+
"parts": [
34+
"number"
35+
]
36+
},
37+
"op": "%",
38+
"right": {
39+
"type": "Integer",
40+
"value": 2
41+
}
42+
},
43+
"then": {
44+
"parts": [
45+
"number"
46+
]
47+
},
48+
"else": {
49+
"type": "Integer",
50+
"value": 0
51+
}
52+
},
53+
"alias": "x"
54+
}
55+
],
56+
"from": {
57+
"tables": [
58+
{
59+
"table": {
60+
"table": {
61+
"database": "system",
62+
"table": "numbers"
63+
}
64+
}
65+
}
66+
]
67+
},
68+
"limit": {
69+
"type": "Integer",
70+
"value": 10
71+
}
72+
}
73+
]
74+
}
75+
}
76+
}
77+
}
78+
]
79+
},
80+
"group_by": [
81+
{
82+
"parts": [
83+
"k"
84+
]
85+
}
86+
],
87+
"order_by": [
88+
{
89+
"expression": {
90+
"parts": [
91+
"k"
92+
]
93+
}
94+
}
95+
]
96+
}
97+
]
98+
}

0 commit comments

Comments
 (0)