Skip to content

Commit 29281b1

Browse files
committed
Apply comments
1 parent 0904fc9 commit 29281b1

5 files changed

Lines changed: 21 additions & 7 deletions

File tree

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/PlanParserSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,11 +473,11 @@ class PlanParserSuite extends PlanTest {
473473

474474
test("SPARK-20311 range(N) as alias") {
475475
assertEqual(
476-
"select * from range(10) AS t",
476+
"SELECT * FROM range(10) AS t",
477477
SubqueryAlias("t", UnresolvedTableValuedFunction("range", Literal(10) :: Nil, Seq.empty))
478478
.select(star()))
479479
assertEqual(
480-
"select * from range(7) AS t(a)",
480+
"SELECT * FROM range(7) AS t(a)",
481481
SubqueryAlias("t", UnresolvedTableValuedFunction("range", Literal(7) :: Nil, "a" :: Nil))
482482
.select(star()))
483483
}

sql/core/src/test/resources/sql-tests/inputs/inline-table.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ select * from values ("one", count(1)), ("two", 2) as data(a, b);
4949

5050
-- string to timestamp
5151
select * from values (timestamp('1991-12-06 00:00:00.0'), array(timestamp('1991-12-06 01:00:00.0'), timestamp('1991-12-06 12:00:00.0'))) as data(a, b);
52+
53+
-- cross-join inline tables
54+
SELECT * FROM VALUES ('one', 1), ('three', null) CROSS JOIN VALUES ('one', 1), ('three', null);

sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ select * from RaNgE(2);
2626
EXPLAIN select * from RaNgE(2);
2727

2828
-- cross-join table valued functions
29-
set spark.sql.crossJoin.enabled=true;
30-
EXPLAIN EXTENDED select * from range(3) cross join range(3);
29+
SET spark.sql.crossJoin.enabled=true;
30+
EXPLAIN EXTENDED SELECT * FROM range(3) CROSS JOIN range(3);

sql/core/src/test/resources/sql-tests/results/inline-table.sql.out

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Automatically generated by SQLQueryTestSuite
2-
-- Number of queries: 17
2+
-- Number of queries: 18
33

44

55
-- !query 0
@@ -151,3 +151,14 @@ select * from values (timestamp('1991-12-06 00:00:00.0'), array(timestamp('1991-
151151
struct<a:timestamp,b:array<timestamp>>
152152
-- !query 16 output
153153
1991-12-06 00:00:00 [1991-12-06 01:00:00.0,1991-12-06 12:00:00.0]
154+
155+
156+
-- !query 17
157+
SELECT * FROM VALUES ('one', 1), ('three', null) CROSS JOIN VALUES ('one', 1), ('three', null)
158+
-- !query 17 schema
159+
struct<col1:string,col2:int,col1:string,col2:int>
160+
-- !query 17 output
161+
one 1 one 1
162+
one 1 three NULL
163+
three NULL one 1
164+
three NULL three NULL

sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ struct<plan:string>
106106

107107

108108
-- !query 9
109-
set spark.sql.crossJoin.enabled=true
109+
SET spark.sql.crossJoin.enabled=true
110110
-- !query 9 schema
111111
struct<key:string,value:string>
112112
-- !query 9 output
113113
spark.sql.crossJoin.enabled true
114114

115115

116116
-- !query 10
117-
EXPLAIN EXTENDED select * from range(3) cross join range(3)
117+
EXPLAIN EXTENDED SELECT * FROM range(3) CROSS JOIN range(3)
118118
-- !query 10 schema
119119
struct<plan:string>
120120
-- !query 10 output

0 commit comments

Comments
 (0)