-
Notifications
You must be signed in to change notification settings - Fork 28.2k
/
select_implicit.sql.out
executable file
·425 lines (337 loc) · 6.83 KB
/
select_implicit.sql.out
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 38
-- !query 0
CREATE TABLE test_missing_target (a int, b int, c string, d string) using parquet
-- !query 0 schema
struct<>
-- !query 0 output
-- !query 1
INSERT INTO test_missing_target VALUES (0, 1, 'XXXX', 'A')
-- !query 1 schema
struct<>
-- !query 1 output
-- !query 2
INSERT INTO test_missing_target VALUES (1, 2, 'ABAB', 'b')
-- !query 2 schema
struct<>
-- !query 2 output
-- !query 3
INSERT INTO test_missing_target VALUES (2, 2, 'ABAB', 'c')
-- !query 3 schema
struct<>
-- !query 3 output
-- !query 4
INSERT INTO test_missing_target VALUES (3, 3, 'BBBB', 'D')
-- !query 4 schema
struct<>
-- !query 4 output
-- !query 5
INSERT INTO test_missing_target VALUES (4, 3, 'BBBB', 'e')
-- !query 5 schema
struct<>
-- !query 5 output
-- !query 6
INSERT INTO test_missing_target VALUES (5, 3, 'bbbb', 'F')
-- !query 6 schema
struct<>
-- !query 6 output
-- !query 7
INSERT INTO test_missing_target VALUES (6, 4, 'cccc', 'g')
-- !query 7 schema
struct<>
-- !query 7 output
-- !query 8
INSERT INTO test_missing_target VALUES (7, 4, 'cccc', 'h')
-- !query 8 schema
struct<>
-- !query 8 output
-- !query 9
INSERT INTO test_missing_target VALUES (8, 4, 'CCCC', 'I')
-- !query 9 schema
struct<>
-- !query 9 output
-- !query 10
INSERT INTO test_missing_target VALUES (9, 4, 'CCCC', 'j')
-- !query 10 schema
struct<>
-- !query 10 output
-- !query 11
SELECT c, count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c
-- !query 11 schema
struct<c:string,count(1):bigint>
-- !query 11 output
ABAB 2
BBBB 2
CCCC 2
XXXX 1
bbbb 1
cccc 2
-- !query 12
SELECT count(*) FROM test_missing_target GROUP BY test_missing_target.c ORDER BY c
-- !query 12 schema
struct<count(1):bigint>
-- !query 12 output
2
2
2
1
1
2
-- !query 13
SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b
-- !query 13 schema
struct<>
-- !query 13 output
org.apache.spark.sql.AnalysisException
cannot resolve '`b`' given input columns: [count(1)]; line 1 pos 61
-- !query 14
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b
-- !query 14 schema
struct<count(1):bigint>
-- !query 14 output
1
2
3
4
-- !query 15
SELECT test_missing_target.b, count(*)
FROM test_missing_target GROUP BY b ORDER BY b
-- !query 15 schema
struct<b:int,count(1):bigint>
-- !query 15 output
1 1
2 2
3 3
4 4
-- !query 16
SELECT c FROM test_missing_target ORDER BY a
-- !query 16 schema
struct<c:string>
-- !query 16 output
XXXX
ABAB
ABAB
BBBB
BBBB
bbbb
cccc
cccc
CCCC
CCCC
-- !query 17
SELECT count(*) FROM test_missing_target GROUP BY b ORDER BY b desc
-- !query 17 schema
struct<count(1):bigint>
-- !query 17 output
4
3
2
1
-- !query 18
SELECT count(*) FROM test_missing_target ORDER BY 1 desc
-- !query 18 schema
struct<count(1):bigint>
-- !query 18 output
10
-- !query 19
SELECT c, count(*) FROM test_missing_target GROUP BY 1 ORDER BY 1
-- !query 19 schema
struct<c:string,count(1):bigint>
-- !query 19 output
ABAB 2
BBBB 2
CCCC 2
XXXX 1
bbbb 1
cccc 2
-- !query 20
SELECT c, count(*) FROM test_missing_target GROUP BY 3
-- !query 20 schema
struct<>
-- !query 20 output
org.apache.spark.sql.AnalysisException
GROUP BY position 3 is not in select list (valid range is [1, 2]); line 1 pos 53
-- !query 21
SELECT count(*) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY b ORDER BY b
-- !query 21 schema
struct<>
-- !query 21 output
org.apache.spark.sql.AnalysisException
Reference 'b' is ambiguous, could be: x.b, y.b.; line 3 pos 10
-- !query 22
SELECT a, a FROM test_missing_target
ORDER BY a
-- !query 22 schema
struct<a:int,a:int>
-- !query 22 output
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
-- !query 23
SELECT a/2, a/2 FROM test_missing_target
ORDER BY a/2
-- !query 23 schema
struct<(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double,(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double>
-- !query 23 output
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.5 2.5
3.0 3.0
3.5 3.5
4.0 4.0
4.5 4.5
-- !query 24
SELECT a/2, a/2 FROM test_missing_target
GROUP BY a/2 ORDER BY a/2
-- !query 24 schema
struct<(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double,(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double>
-- !query 24 output
0.0 0.0
0.5 0.5
1.0 1.0
1.5 1.5
2.0 2.0
2.5 2.5
3.0 3.0
3.5 3.5
4.0 4.0
4.5 4.5
-- !query 25
SELECT x.b, count(*) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY x.b ORDER BY x.b
-- !query 25 schema
struct<b:int,count(1):bigint>
-- !query 25 output
1 1
2 2
3 3
4 4
-- !query 26
SELECT count(*) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY x.b ORDER BY x.b
-- !query 26 schema
struct<count(1):bigint>
-- !query 26 output
1
2
3
4
-- !query 27
SELECT a%2, count(b) FROM test_missing_target
GROUP BY test_missing_target.a%2
ORDER BY test_missing_target.a%2
-- !query 27 schema
struct<(a % 2):int,count(b):bigint>
-- !query 27 output
0 5
1 5
-- !query 28
SELECT count(c) FROM test_missing_target
GROUP BY lower(test_missing_target.c)
ORDER BY lower(test_missing_target.c)
-- !query 28 schema
struct<count(c):bigint>
-- !query 28 output
2
3
4
1
-- !query 29
SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b
-- !query 29 schema
struct<>
-- !query 29 output
org.apache.spark.sql.AnalysisException
cannot resolve '`b`' given input columns: [count(a)]; line 1 pos 61
-- !query 30
SELECT count(b) FROM test_missing_target GROUP BY b/2 ORDER BY b/2
-- !query 30 schema
struct<count(b):bigint>
-- !query 30 output
1
2
3
4
-- !query 31
SELECT lower(test_missing_target.c), count(c)
FROM test_missing_target GROUP BY lower(c) ORDER BY lower(c)
-- !query 31 schema
struct<lower(c):string,count(c):bigint>
-- !query 31 output
abab 2
bbbb 3
cccc 4
xxxx 1
-- !query 32
SELECT a FROM test_missing_target ORDER BY upper(d)
-- !query 32 schema
struct<a:int>
-- !query 32 output
0
1
2
3
4
5
6
7
8
9
-- !query 33
SELECT count(b) FROM test_missing_target
GROUP BY (b + 1) / 2 ORDER BY (b + 1) / 2 desc
-- !query 33 schema
struct<count(b):bigint>
-- !query 33 output
4
3
2
1
-- !query 34
SELECT count(x.a) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY b/2 ORDER BY b/2
-- !query 34 schema
struct<>
-- !query 34 output
org.apache.spark.sql.AnalysisException
Reference 'b' is ambiguous, could be: x.b, y.b.; line 3 pos 10
-- !query 35
SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY x.b/2 ORDER BY x.b/2
-- !query 35 schema
struct<(CAST(b AS DOUBLE) / CAST(2 AS DOUBLE)):double,count(b):bigint>
-- !query 35 output
0.5 1
1.0 2
1.5 3
2.0 4
-- !query 36
SELECT count(b) FROM test_missing_target x, test_missing_target y
WHERE x.a = y.a
GROUP BY x.b/2
-- !query 36 schema
struct<>
-- !query 36 output
org.apache.spark.sql.AnalysisException
Reference 'b' is ambiguous, could be: x.b, y.b.; line 1 pos 13
-- !query 37
DROP TABLE test_missing_target
-- !query 37 schema
struct<>
-- !query 37 output