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-14600][SQL] Push predicates through Expand #12496

Closed
wants to merge 2 commits into from

Conversation

cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

https://issues.apache.org/jira/browse/SPARK-14600

This PR makes Expand.output have different attributes from the grouping attributes produced by the underlying Project, as they have different meaning, so that we can safely push down filter through Expand

How was this patch tested?

existing tests.

@cloud-fan
Copy link
Contributor Author

cc @davies

@SparkQA
Copy link

SparkQA commented Apr 19, 2016

Test build #56225 has finished for PR 12496 at commit 30dbdc6.

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


// the `groupByAttrs` has different meaning in `Expand.output`, it could be the original
// grouping expression or null, so here we create new instance of it.
val output = child.output ++ groupByAttrs.map(_.newInstance) :+ gid
Expand(projections, output, Project(child.output ++ groupByAliases, child))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this Project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or we will evaluate the grouping expressions many times.

@SparkQA
Copy link

SparkQA commented Apr 20, 2016

Test build #56315 has finished for PR 12496 at commit ee62497.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@davies
Copy link
Contributor

davies commented Apr 20, 2016

LGTM,
Merging this into master, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants