Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 3af3f5d

Browse files
committed
Test JSON files for specs. Refs #3
1 parent 4d00f9f commit 3af3f5d

File tree

61 files changed

+5325
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+5325
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"statement": [
3+
{
4+
"type": "statement",
5+
"variant": "select",
6+
"result": [
7+
{
8+
"type": "identifier",
9+
"variant": "column",
10+
"name": "apple",
11+
"alias": "The Apple"
12+
},
13+
{
14+
"type": "identifier",
15+
"variant": "column",
16+
"name": "pear",
17+
"alias": "the_pear"
18+
},
19+
{
20+
"type": "identifier",
21+
"variant": "column",
22+
"name": "orange",
23+
"alias": "TheOrange"
24+
},
25+
{
26+
"type": "identifier",
27+
"variant": "column",
28+
"name": "pineapple",
29+
"alias": "wherekeyword"
30+
}
31+
],
32+
"from": [
33+
{
34+
"type": "identifier",
35+
"variant": "table",
36+
"name": "bananas",
37+
"alias": "b"
38+
}
39+
]
40+
}
41+
]
42+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"statement": [
3+
{
4+
"type": "statement",
5+
"variant": "select",
6+
"result": [
7+
{
8+
"type": "identifier",
9+
"variant": "star",
10+
"name": "hat.*"
11+
},
12+
{
13+
"type": "function",
14+
"name": "count",
15+
"args": [
16+
{
17+
"type": "identifier",
18+
"variant": "star",
19+
"name": "*"
20+
}
21+
],
22+
"alias": "pants"
23+
}
24+
],
25+
"from": [
26+
{
27+
"type": "identifier",
28+
"variant": "table",
29+
"name": "hats",
30+
"alias": "hat"
31+
}
32+
]
33+
}
34+
]
35+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"statement": [
3+
{
4+
"type": "statement",
5+
"variant": "select",
6+
"result": [
7+
{
8+
"type": "literal",
9+
"variant": "decimal",
10+
"value": "1"
11+
}
12+
]
13+
},
14+
{
15+
"type": "statement",
16+
"variant": "select",
17+
"result": [
18+
{
19+
"type": "identifier",
20+
"variant": "column",
21+
"name": "movie_id"
22+
}
23+
],
24+
"from": [
25+
{
26+
"type": "identifier",
27+
"variant": "table",
28+
"name": "rooms",
29+
"alias": "hat"
30+
}
31+
],
32+
"where": [
33+
{
34+
"type": "expression",
35+
"format": "binary",
36+
"variant": "operation",
37+
"operation": ">",
38+
"left": {
39+
"type": "identifier",
40+
"variant": "column",
41+
"name": "seats"
42+
},
43+
"right": {
44+
"type": "literal",
45+
"variant": "decimal",
46+
"value": "75"
47+
}
48+
}
49+
]
50+
},
51+
{
52+
"type": "statement",
53+
"variant": "select",
54+
"result": [
55+
{
56+
"type": "literal",
57+
"variant": "decimal",
58+
"value": "2"
59+
}
60+
],
61+
"from": [
62+
{
63+
"type": "identifier",
64+
"variant": "table",
65+
"name": "hats"
66+
}
67+
]
68+
}
69+
]
70+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"statement": [
3+
{
4+
"type": "statement",
5+
"target": {
6+
"type": "identifier",
7+
"variant": "index",
8+
"name": "bees.hive_state"
9+
},
10+
"on": {
11+
"target": "hive",
12+
"columns": [
13+
{
14+
"type": "identifier",
15+
"variant": "column",
16+
"format": "indexed",
17+
"name": "happiness",
18+
"direction": "asc"
19+
},
20+
{
21+
"type": "identifier",
22+
"variant": "column",
23+
"format": "indexed",
24+
"name": "anger",
25+
"direction": "desc"
26+
}
27+
]
28+
},
29+
"variant": "create",
30+
"format": "index",
31+
"where": [
32+
{
33+
"type": "expression",
34+
"format": "binary",
35+
"variant": "operation",
36+
"operation": ">",
37+
"left": {
38+
"type": "identifier",
39+
"variant": "column",
40+
"name": "anger"
41+
},
42+
"right": {
43+
"type": "literal",
44+
"variant": "decimal",
45+
"value": "0"
46+
}
47+
}
48+
]
49+
}
50+
]
51+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"statement": [
3+
{
4+
"type": "statement",
5+
"name": {
6+
"type": "identifier",
7+
"variant": "table",
8+
"name": "advertisements"
9+
},
10+
"temporary": false,
11+
"variant": "create",
12+
"format": "table",
13+
"definition": [
14+
{
15+
"type": "definition",
16+
"variant": "column",
17+
"name": "id",
18+
"definition": [
19+
{
20+
"name": null,
21+
"type": "constraint",
22+
"variant": "primary key"
23+
}
24+
],
25+
"datatype": {
26+
"type": "datatype",
27+
"variant": "int",
28+
"affinity": "integer",
29+
"args": []
30+
}
31+
},
32+
{
33+
"type": "definition",
34+
"variant": "column",
35+
"name": "name",
36+
"definition": [],
37+
"datatype": {
38+
"type": "datatype",
39+
"variant": "varchar",
40+
"affinity": "text",
41+
"args": [
42+
{
43+
"type": "literal",
44+
"variant": "decimal",
45+
"value": "50"
46+
}
47+
]
48+
}
49+
},
50+
{
51+
"type": "definition",
52+
"variant": "column",
53+
"name": "category",
54+
"definition": [],
55+
"datatype": {
56+
"type": "datatype",
57+
"variant": "varchar",
58+
"affinity": "text",
59+
"args": [
60+
{
61+
"type": "literal",
62+
"variant": "decimal",
63+
"value": "15"
64+
}
65+
]
66+
}
67+
},
68+
{
69+
"type": "definition",
70+
"variant": "column",
71+
"name": "cost",
72+
"definition": [],
73+
"datatype": {
74+
"type": "datatype",
75+
"variant": "int",
76+
"affinity": "integer",
77+
"args": []
78+
}
79+
}
80+
]
81+
}
82+
]
83+
}

0 commit comments

Comments
 (0)