/
union_clause.test.json
115 lines (115 loc) · 2.73 KB
/
union_clause.test.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
[
{
"namePrefix": "should suggest keywords",
"beforeCursor": "SELECT * FROM database_two.testTable ORDER BY foo LIMIT 10 ",
"afterCursor": "",
"containsKeywords": [
"UNION"
],
"expectedResult": {
"lowerCase": false
}
},
{
"namePrefix": "should not report errors",
"beforeCursor": "SELECT key FROM (SELECT key FROM src ORDER BY key LIMIT 10)subq1 UNION SELECT key FROM (SELECT key FROM src1 ORDER BY key LIMIT 10)subq2;",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"SELECT"
],
"expectedResult": {
"lowerCase": false
}
},
{
"namePrefix": "should not report errors",
"beforeCursor": "SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2;",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"SELECT"
],
"expectedResult": {
"lowerCase": false
}
},
{
"namePrefix": "should not report errors",
"beforeCursor": "SELECT * FROM t1 UNION SELECT * FROM t2;",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"SELECT"
],
"expectedResult": {
"lowerCase": false
}
},
{
"namePrefix": "should suggest keywords",
"beforeCursor": "SELECT * FROM t1 UNION ",
"afterCursor": "",
"noErrors": true,
"expectedResult": {
"lowerCase": false,
"suggestKeywords": [
"ALL",
"DISTINCT",
"SELECT"
]
}
},
{
"namePrefix": "should suggest tables",
"beforeCursor": "SELECT * FROM t1 UNION ALL SELECT ",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"*",
"ALL",
"DISTINCT"
],
"expectedResult": {
"lowerCase": false,
"suggestAggregateFunctions": {
"tables": []
},
"suggestAnalyticFunctions": true,
"suggestFunctions": {},
"suggestTables": {
"prependQuestionMark": true,
"prependFrom": true
},
"suggestDatabases": {
"prependQuestionMark": true,
"prependFrom": true,
"appendDot": true
}
}
},
{
"namePrefix": "should not report errors",
"beforeCursor": "WITH q1 AS (SELECT * FROM src WHERE something), q2 AS (SELECT * FROM src s2 WHERE something) SELECT * FROM q1 UNION ALL SELECT * FROM q2;",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"SELECT"
],
"expectedResult": {
"lowerCase": false
}
},
{
"namePrefix": "should not report errors",
"beforeCursor": "WITH t1 AS (SELECT 1) (WITH t2 AS (SELECT 2) SELECT * FROM t2) UNION ALL SELECT * FROM t1;",
"afterCursor": "",
"noErrors": true,
"containsKeywords": [
"SELECT"
],
"expectedResult": {
"lowerCase": false
}
}
]