Skip to content

[SPARK-13351] [SQL] fix column pruning on Expand#11225

Closed
davies wants to merge 1 commit intoapache:masterfrom
davies:fix_pruning_expand
Closed

[SPARK-13351] [SQL] fix column pruning on Expand#11225
davies wants to merge 1 commit intoapache:masterfrom
davies:fix_pruning_expand

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.

*/
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

Development

Successfully merging this pull request may close these issues.

3 participants

Comments