Skip to content

Conversation

@cloud-fan
Copy link
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
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
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
Contributor

Choose a reason for hiding this comment

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

Copy link
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
Contributor

Choose a reason for hiding this comment

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

Copy link
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
Copy link

SparkQA commented Oct 20, 2016

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
Copy link
Contributor

mallman commented Oct 20, 2016

LGTM.

@asfgit asfgit closed this in 57e97fc Oct 21, 2016
@cloud-fan
Copy link
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 <[email protected]>

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 <[email protected]>

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