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
|
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 9
-- !query 0
select * from dummy(3)
-- !query 0 schema
struct<>
-- !query 0 output
org.apache.spark.sql.AnalysisException
could not resolve `dummy` to a table-valued function; line 1 pos 14
-- !query 1
select * from range(6 + cos(3))
-- !query 1 schema
struct<id:bigint>
-- !query 1 output
0
1
2
3
4
-- !query 2
select * from range(5, 10)
-- !query 2 schema
struct<id:bigint>
-- !query 2 output
5
6
7
8
9
-- !query 3
select * from range(0, 10, 2)
-- !query 3 schema
struct<id:bigint>
-- !query 3 output
0
2
4
6
8
-- !query 4
select * from range(0, 10, 1, 200)
-- !query 4 schema
struct<id:bigint>
-- !query 4 output
0
1
2
3
4
5
6
7
8
9
-- !query 5
select * from range(1, 1, 1, 1, 1)
-- !query 5 schema
struct<>
-- !query 5 output
org.apache.spark.sql.AnalysisException
error: table-valued function range with alternatives:
(end: long)
(start: long, end: long)
(start: long, end: long, step: long)
(start: long, end: long, step: long, numPartitions: integer)
cannot be applied to: (integer, integer, integer, integer, integer); line 1 pos 14
-- !query 6
select * from range(1, null)
-- !query 6 schema
struct<>
-- !query 6 output
java.lang.IllegalArgumentException
Invalid arguments for resolved function: 1, null
-- !query 7
select * from RaNgE(2)
-- !query 7 schema
struct<id:bigint>
-- !query 7 output
0
1
-- !query 8
EXPLAIN select * from RaNgE(2)
-- !query 8 schema
struct<plan:string>
-- !query 8 output
== Physical Plan ==
*Range (0, 2, step=1, splits=None)
|