-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-13603] [SQL] support SQL generation for subquery #11453
Conversation
Test build #52264 has finished for PR 11453 at commit
|
Test build #52267 has finished for PR 11453 at commit
|
|
||
test("subquery") { | ||
checkSqlGeneration("SELECT 1 + (SELECT 2)") | ||
checkSqlGeneration("SELECT 1 + (SELECT 2 + (SELECT 3 as a))") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add more test cases?
SELECT * from (SELECT 1 + (SELECT 2 + (SELECT 3 as a)) t
If we run this, we hit a bug in Scalar Subquery support. If you want, I can try to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into it, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed a )
here.
I don't think this is a good test case for this suite. (it works by the way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my fault. : )
How about moving a few typical scalar queries in SubquerySuite
to this test suite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary, different test suite for different purpose, we should not repeat every test cases everywhere.
cc @liancheng |
Conflicts: sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala
Test build #52443 has finished for PR 11453 at commit
|
LGTM, merged to master. Thanks! |
## What changes were proposed in this pull request? This is support SQL generation for subquery expressions, which will be replaced to a SubqueryHolder inside SQLBuilder recursively. ## How was this patch tested? Added unit tests. Author: Davies Liu <davies@databricks.com> Closes apache#11453 from davies/sql_subquery.
What changes were proposed in this pull request?
This is support SQL generation for subquery expressions, which will be replaced to a SubqueryHolder inside SQLBuilder recursively.
How was this patch tested?
Added unit tests.