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-13351] [SQL] fix column pruning on Expand #11225

Closed
wants to merge 1 commit into from

Conversation

davies
Copy link
Contributor

@davies davies commented Feb 17, 2016

Currently, the columns in projects of Expand that are not used by Aggregate are not pruned, this PR fix that.

@SparkQA
Copy link

SparkQA commented Feb 17, 2016

Test build #51397 has finished for PR 11225 at commit bfa6896.

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

@@ -300,6 +300,16 @@ object SetOperationPushDown extends Rule[LogicalPlan] with PredicateHelper {
*/
object ColumnPruning extends Rule[LogicalPlan] {
def apply(plan: LogicalPlan): LogicalPlan = plan transform {
case a @ Aggregate(_, _, e @ Expand(projects, output, child))
Copy link
Contributor

Choose a reason for hiding this comment

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

To summarize my understanding for other reviewers:

This new rule handles the case where you have an expand beneath an aggregate and the expand produces rows with columns which are not referenced by the aggregate operator. In this case, we want to rewrite the expand's projections in order to eliminate the unreferenced column.

@JoshRosen
Copy link
Contributor

LGTM. This change looks correct to me.

I'm going to merge this PR into master.

@asfgit asfgit closed this in 26f38bb Feb 18, 2016
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