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
|
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 9
-- !query 0
select * from testdata limit 2
-- !query 0 schema
struct<key:int,value:string>
-- !query 0 output
1 1
2 2
-- !query 1
select * from arraydata limit 2
-- !query 1 schema
struct<arraycol:array<int>,nestedarraycol:array<array<int>>>
-- !query 1 output
[1,2,3] [[1,2,3]]
[2,3,4] [[2,3,4]]
-- !query 2
select * from mapdata limit 2
-- !query 2 schema
struct<mapcol:map<int,string>>
-- !query 2 output
{1:"a1",2:"b1",3:"c1",4:"d1",5:"e1"}
{1:"a2",2:"b2",3:"c2",4:"d2"}
-- !query 3
select * from testdata limit 2 + 1
-- !query 3 schema
struct<key:int,value:string>
-- !query 3 output
1 1
2 2
3 3
-- !query 4
select * from testdata limit CAST(1 AS int)
-- !query 4 schema
struct<key:int,value:string>
-- !query 4 output
1 1
-- !query 5
select * from testdata limit -1
-- !query 5 schema
struct<>
-- !query 5 output
org.apache.spark.sql.AnalysisException
The limit expression must be equal to or greater than 0, but got -1;
-- !query 6
select * from testdata limit key > 3
-- !query 6 schema
struct<>
-- !query 6 output
org.apache.spark.sql.AnalysisException
The limit expression must evaluate to a constant value, but got (testdata.`key` > 3);
-- !query 7
select * from testdata limit true
-- !query 7 schema
struct<>
-- !query 7 output
org.apache.spark.sql.AnalysisException
The limit expression must be integer type, but got boolean;
-- !query 8
select * from testdata limit 'a'
-- !query 8 schema
struct<>
-- !query 8 output
org.apache.spark.sql.AnalysisException
The limit expression must be integer type, but got string;
|