Skip to content
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-12719][SQL] SQL generation support for Generate #11768

Closed
wants to merge 1 commit into from
Closed

[SPARK-12719][SQL] SQL generation support for Generate #11768

wants to merge 1 commit into from

Conversation

yhuai
Copy link
Contributor

@yhuai yhuai commented Mar 16, 2016

What changes were proposed in this pull request?

This PR adds SQL generation support for Generate operator. It always converts Generate operator into LATERAL VIEW format as there are many limitations to put UDTF in project list.

This PR is based on #11658, please see the last commit to review the real changes.

Thanks @dilipbiswal for his initial work! Takes over #11596

How was this patch tested?

new tests in LogicalPlanToSQLSuite

@SparkQA
Copy link

SparkQA commented Mar 16, 2016

Test build #53337 has finished for PR 11768 at commit 9a6e27d.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

// This only happens when we put UDTF in project list and there is no FROM clause. Because we
// always generate LATERAL VIEW for `Generate`, here we use a trick to put a dummy sub-query
// after FROM clause, so that we can generate a valid LATERAL VIEW SQL string.
s"(SELECT 1) ${SQLBuilder.newSubqueryName}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put a concrete example at here?

@yhuai
Copy link
Contributor Author

yhuai commented Mar 16, 2016

@cloud-fan I resolved the conflict and the commit at here. You can cherry-pick this commit to your original branch (and keep using that) or you can push update directly to my branch.

SQLBuilder.newSubqueryName,
"AS",
columnAliases
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This build call has many arguments. It will be good to put an example at here.

@yhuai
Copy link
Contributor Author

yhuai commented Mar 16, 2016

@cloud-fan Overall it looks good. I have left a few comments.

@SparkQA
Copy link

SparkQA commented Mar 16, 2016

Test build #53339 has finished for PR 11768 at commit d0c1e1d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yhuai
Copy link
Contributor Author

yhuai commented Mar 18, 2016

Closing it.

@yhuai yhuai closed this Mar 18, 2016
@yhuai yhuai deleted the generate_1 branch March 18, 2016 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants