-
Notifications
You must be signed in to change notification settings - Fork 447
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
[GLUTEN-6202][VL] No extra SortExec needed before WindowExec if window type is sort
#6203
Conversation
Run Gluten Clickhouse CI |
84704f2
to
b4bea80
Compare
Run Gluten Clickhouse CI |
cc @JkSelf |
b4bea80
to
a9a1fd1
Compare
Run Gluten Clickhouse CI |
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.
Thanks.
child | ||
case p @ ProjectExec(_, SortExec(_, false, child, _)) | ||
if outputOrderSatisfied(child, transformer.requiredChildOrdering) => | ||
p.copy(child = child) |
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.
Any reason not using p.withNewChildren
to keep tags?
private def outputOrderSatisfied(child: SparkPlan, required: Seq[Seq[SortOrder]]): Boolean = { | ||
Seq(child).zip(required).forall { | ||
case (child, requiredOrdering) => | ||
SortOrder.orderingSatisfies(child.outputOrdering, requiredOrdering) | ||
} | ||
} |
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.
Could just assume an unary node is returned from replace.doReplace(window)
then we can avoid zip
to simplify code.
Run Gluten Clickhouse CI |
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.
Just one nit left, thank you for the update.
val transformer = replace.doReplace(window) | ||
val newChild = transformer.children.head match { |
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.
Oops, let's either add an assertion like assert(transformer.children.size == 1)
, or cast it to a unary node.
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,got it
And CH CI failed https://opencicd.kyligence.com/job/gluten/job/gluten-ci/10302/, please also take a look. Thanks. |
Run Gluten Clickhouse CI |
5340e52
to
f645924
Compare
Run Gluten Clickhouse CI |
f645924
to
5c62404
Compare
Run Gluten Clickhouse CI |
Run Gluten Clickhouse CI |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
What changes were proposed in this pull request?
When
spark.gluten.sql.columnar.backend.velox.window.type
is set tosort
, there should be no extraSortExec
beforeWindowExec
in plan.(Fixes: #6202)
How was this patch tested?
Mannual Test and UT