fix: Check sort order of SortExec instead of child output#821
Merged
viirya merged 2 commits intoapache:mainfrom Aug 13, 2024
Merged
fix: Check sort order of SortExec instead of child output#821viirya merged 2 commits intoapache:mainfrom
viirya merged 2 commits intoapache:mainfrom
Conversation
viirya
commented
Aug 13, 2024
| if isCometOperatorEnabled(op.conf, CometConf.OPERATOR_SORT) => | ||
| // TODO: Remove this constraint when we upgrade to new arrow-rs including | ||
| // https://github.com/apache/arrow-rs/pull/6225 | ||
| if (child.output.length == 1 && child.output.head.dataType.isInstanceOf[StructType]) { |
Member
Author
There was a problem hiding this comment.
It should be the column to sort (i.e., sort order) instead of child output. I made it wrong in #811.
viirya
commented
Aug 13, 2024
| val sortOrders = plan.sortOrder.map(exprToProto(_, plan.child.output)) | ||
| exprs.forall(_.isDefined) && sortOrders.forall(_.isDefined) && getOffset(plan).getOrElse( | ||
| 0) == 0 | ||
| 0) == 0 && supportedSortType(plan, plan.sortOrder) |
Member
Author
There was a problem hiding this comment.
CometTakeOrderedAndProjectExec will invoke DataFusion SortExec operator, so we should also check for it.
viirya
commented
Aug 13, 2024
Comment on lines
+3057
to
+3058
| if (sortOrder.length == 1 && sortOrder.head.dataType.isInstanceOf[StructType]) { | ||
| withInfo(op, "Sort on single struct column is not supported") |
Member
Author
There was a problem hiding this comment.
As @andygrove mentioned in #811, there are some more types that are not supported. I will add them in other PR.
andygrove
approved these changes
Aug 13, 2024
huaxingao
approved these changes
Aug 13, 2024
Member
Author
|
Thanks @andygrove @huaxingao |
himadripal
pushed a commit
to himadripal/datafusion-comet
that referenced
this pull request
Sep 7, 2024
* fix: Check sort order of SortExec instead of child output * Remove unused import (cherry picked from commit 81af72f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #822.
Rationale for this change
What changes are included in this PR?
How are these changes tested?