-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-46485][SQL] V1Write should not add Sort when not needed #44458
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,8 +102,8 @@ object V1Writes extends Rule[LogicalPlan] with SQLConfHelper { | |
| val requiredOrdering = write.requiredOrdering.map(_.transform { | ||
| case a: Attribute => attrMap.getOrElse(a, a) | ||
| }.asInstanceOf[SortOrder]) | ||
| val outputOrdering = query.outputOrdering | ||
| val orderingMatched = isOrderingMatched(requiredOrdering, outputOrdering) | ||
| val outputOrdering = empty2NullPlan.outputOrdering | ||
| val orderingMatched = isOrderingMatched(requiredOrdering.map(_.child), outputOrdering) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, so it was never matched before... |
||
| if (orderingMatched) { | ||
| empty2NullPlan | ||
| } else { | ||
|
|
||
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 rough remember before we did not support preserve ordering through empty2null so use the
query.outputOrdering. I think useempty2NullPlan.outputOrderingis the expected behaviorThere 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.
Yea Project is an
OrderPreservingUnaryNodeso it should be fine.