-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 10
-- !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;
-- !query 9
select * from (select * from range(10) limit 5) where id > 3
-- !query 9 schema
struct<id:bigint>
-- !query 9 output
4