Skip to content

[SPARK-18029][SQL] PruneFileSourcePartitions should not change the output of LogicalRelation#15569

Closed
cloud-fan wants to merge 1 commit into
apache:masterfrom
cloud-fan:partition-bug
Closed

[SPARK-18029][SQL] PruneFileSourcePartitions should not change the output of LogicalRelation#15569
cloud-fan wants to merge 1 commit into
apache:masterfrom
cloud-fan:partition-bug

Conversation

@cloud-fan

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

In PruneFileSourcePartitions, we will replace the LogicalRelation with a pruned one. However, this replacement may change the output of the LogicalRelation if it doesn't have expectedOutputAttributes. This PR fixes it.

How was this patch tested?

the new PruneFileSourcePartitionsSuite

@cloud-fan

Copy link
Copy Markdown
Contributor Author

cc @ericl @mallman @yhuai

def toRow(partitionSchema: StructType): InternalRow = {
InternalRow.fromSeq(partitionSchema.map { case StructField(name, dataType, _, _) =>
Cast(Literal(spec(name)), dataType).eval()
InternalRow.fromSeq(partitionSchema.map { field =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are you proposing this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. Do we have a Spark style guide?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok. This change makes sense to me.

@SparkQA

SparkQA commented Oct 20, 2016

Copy link
Copy Markdown

Test build #67269 has finished for PR 15569 at commit 8b4450c.

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

@mallman

mallman commented Oct 20, 2016

Copy link
Copy Markdown
Contributor

LGTM.

@asfgit asfgit closed this in 57e97fc Oct 21, 2016
@cloud-fan

Copy link
Copy Markdown
Contributor Author

thanks for the review, merging to master!

robert3005 pushed a commit to palantir/spark that referenced this pull request Nov 1, 2016
…tput of LogicalRelation

## What changes were proposed in this pull request?

In `PruneFileSourcePartitions`, we will replace the `LogicalRelation` with a pruned one. However, this replacement may change the output of the `LogicalRelation` if it doesn't have `expectedOutputAttributes`. This PR fixes it.

## How was this patch tested?

the new `PruneFileSourcePartitionsSuite`

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#15569 from cloud-fan/partition-bug.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…tput of LogicalRelation

## What changes were proposed in this pull request?

In `PruneFileSourcePartitions`, we will replace the `LogicalRelation` with a pruned one. However, this replacement may change the output of the `LogicalRelation` if it doesn't have `expectedOutputAttributes`. This PR fixes it.

## How was this patch tested?

the new `PruneFileSourcePartitionsSuite`

Author: Wenchen Fan <wenchen@databricks.com>

Closes apache#15569 from cloud-fan/partition-bug.
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.

4 participants