-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-18029][SQL] PruneFileSourcePartitions should not change the output of LogicalRelation #15569
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
Conversation
| def toRow(partitionSchema: StructType): InternalRow = { | ||
| InternalRow.fromSeq(partitionSchema.map { case StructField(name, dataType, _, _) => | ||
| Cast(Literal(spec(name)), dataType).eval() | ||
| InternalRow.fromSeq(partitionSchema.map { field => |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is this one: https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide
But it is fairly basic.
There was a problem hiding this comment.
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.
|
Test build #67269 has finished for PR 15569 at commit
|
|
LGTM. |
|
thanks for the review, merging to master! |
…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.
…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.
What changes were proposed in this pull request?
In
PruneFileSourcePartitions, we will replace theLogicalRelationwith a pruned one. However, this replacement may change the output of theLogicalRelationif it doesn't haveexpectedOutputAttributes. This PR fixes it.How was this patch tested?
the new
PruneFileSourcePartitionsSuite