Uh oh!
There was an error while loading. Please reload this page.
[SPARK-20311][SQL] Support aliases for table value functions - #17928
[SPARK-20311][SQL] Support aliases for table value functions#17928maropu wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
are we breaking existing queries?
SparkQA
commented
May 10, 2017
Test build #76712 has finished for PR 17928 at commit
|
SparkQA
commented
May 10, 2017
Test build #76716 has finished for PR 17928 at commit
|
maropu
commented
May 10, 2017
@cloud-fan ok, could you check again? Thanks! |
cloud-fan
commented
May 10, 2017
LGTM, cc @gatorsmile to take another look |
| ; | ||
| tableAlias | ||
| : (AS? strictIdentifier identifierList?)? |
There was a problem hiding this comment.
This also hits another bug in inline tables. Maybe you also can include the following query in the test case inline-table.sql?
sql("SELECT * FROM VALUES (\"one\", 1), (\"three\", null) CROSS JOIN VALUES (\"one\", 1), (\"three\", null)")
| test("SPARK-20311 range(N) as alias") { | ||
| assertEqual( | ||
| "select * from range(10) AS t", |
There was a problem hiding this comment.
Nit: SELECT * FROM range(10) AS t
BTW, we prefer to use upper case for the SQL keywords.
There was a problem hiding this comment.
You also can update the similar issues in your test cases.
gatorsmile
commented
May 10, 2017
LGTM |
SparkQA
commented
May 10, 2017
Test build #76737 has finished for PR 17928 at commit
|
| EXPLAIN select * from RaNgE(2); | ||
| -- cross-join table valued functions | ||
| SET spark.sql.crossJoin.enabled=true; |
There was a problem hiding this comment.
Could you remove this line? If we specify CROSS JOIN in the query, no need to set this parm.
SparkQA
commented
May 11, 2017
Test build #76770 has finished for PR 17928 at commit
|
| 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); |
There was a problem hiding this comment.
does this expose the bug? If we treat CROSS as an alias, we still get the same result. how about we run EXPLAIN?
SparkQA
commented
May 11, 2017
Test build #76784 has started for PR 17928 at commit |
cloud-fan
commented
May 11, 2017
retest this please |
SparkQA
commented
May 11, 2017
Test build #76791 has finished for PR 17928 at commit
|
gatorsmile
commented
May 11, 2017
Thanks! Merging to master. |
## What changes were proposed in this pull request? This pr added parsing rules to support aliases in table value functions. The previous pr (apache#17666) has been reverted because of the regression. This new pr fixed the regression and add tests in `SQLQueryTestSuite`. ## How was this patch tested? Added tests in `PlanParserSuite` and `SQLQueryTestSuite`. Author: Takeshi Yamamuro <yamamuro@apache.org> Closesapache#17928 from maropu/SPARK-20311-3.
What changes were proposed in this pull request?
This pr added parsing rules to support aliases in table value functions.
The previous pr (#17666) has been reverted because of the regression. This new pr fixed the regression and add tests in
SQLQueryTestSuite.How was this patch tested?
Added tests in
PlanParserSuiteandSQLQueryTestSuite.