Skip to content

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maropu committed May 10, 2017
1 parent 0904fc9 commit 29281b1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
Expand Up @@ -473,11 +473,11 @@ class PlanParserSuite extends PlanTest {

test("SPARK-20311 range(N) as alias") {
assertEqual(
"select * from range(10) AS t",
"SELECT * FROM range(10) AS t",
SubqueryAlias("t", UnresolvedTableValuedFunction("range", Literal(10) :: Nil, Seq.empty))
.select(star()))
assertEqual(
"select * from range(7) AS t(a)",
"SELECT * FROM range(7) AS t(a)",
SubqueryAlias("t", UnresolvedTableValuedFunction("range", Literal(7) :: Nil, "a" :: Nil))
.select(star()))
}
Expand Down
3 changes: 3 additions & 0 deletions sql/core/src/test/resources/sql-tests/inputs/inline-table.sql
Expand Up @@ -49,3 +49,6 @@ select * from values ("one", count(1)), ("two", 2) as data(a, b);

-- string to timestamp
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);

-- cross-join inline tables
SELECT * FROM VALUES ('one', 1), ('three', null) CROSS JOIN VALUES ('one', 1), ('three', null);
Expand Up @@ -26,5 +26,5 @@ select * from RaNgE(2);
EXPLAIN select * from RaNgE(2);

-- cross-join table valued functions
set spark.sql.crossJoin.enabled=true;
EXPLAIN EXTENDED select * from range(3) cross join range(3);
SET spark.sql.crossJoin.enabled=true;
EXPLAIN EXTENDED SELECT * FROM range(3) CROSS JOIN range(3);
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 17
-- Number of queries: 18


-- !query 0
Expand Down Expand Up @@ -151,3 +151,14 @@ select * from values (timestamp('1991-12-06 00:00:00.0'), array(timestamp('1991-
struct<a:timestamp,b:array<timestamp>>
-- !query 16 output
1991-12-06 00:00:00 [1991-12-06 01:00:00.0,1991-12-06 12:00:00.0]


-- !query 17
SELECT * FROM VALUES ('one', 1), ('three', null) CROSS JOIN VALUES ('one', 1), ('three', null)
-- !query 17 schema
struct<col1:string,col2:int,col1:string,col2:int>
-- !query 17 output
one 1 one 1
one 1 three NULL
three NULL one 1
three NULL three NULL
Expand Up @@ -106,15 +106,15 @@ struct<plan:string>


-- !query 9
set spark.sql.crossJoin.enabled=true
SET spark.sql.crossJoin.enabled=true
-- !query 9 schema
struct<key:string,value:string>
-- !query 9 output
spark.sql.crossJoin.enabled true


-- !query 10
EXPLAIN EXTENDED select * from range(3) cross join range(3)
EXPLAIN EXTENDED SELECT * FROM range(3) CROSS JOIN range(3)
-- !query 10 schema
struct<plan:string>
-- !query 10 output
Expand Down

0 comments on commit 29281b1

Please sign in to comment.