-
Notifications
You must be signed in to change notification settings - Fork 164
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
fix: Comet should not translate try_sum to native sum expression #277
Conversation
case s @ Sum(child, _) if sumDataTypeSupported(s.dataType) => | ||
case s @ Sum(child, evalMode) | ||
if sumDataTypeSupported(s.dataType) && | ||
evalMode == EvalMode.LEGACY => |
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.
Hmm, this is introduced in Spark 3.4. So Spark 3.2/3.3 builds are failed due to this change. I need to add a shim layer...
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.
LGTM, except one minor comment.
spark/src/main/scala/org/apache/comet/shims/ShimQueryPlanSerde.scala
Outdated
Show resolved
Hide resolved
@@ -202,7 +202,7 @@ object QueryPlanSerde extends Logging with ShimQueryPlanSerde { | |||
inputs: Seq[Attribute], | |||
binding: Boolean): Option[AggExpr] = { | |||
aggExpr.aggregateFunction match { | |||
case s @ Sum(child, _) if sumDataTypeSupported(s.dataType) => | |||
case s @ Sum(child, _) if sumDataTypeSupported(s.dataType) && isLegacyMode(s) => |
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.
Not part of this PR.
But maybe we should add try_sum and try_xxx aggregation function support in the native side too?
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.
Yea, we should do it. We probably need to implement native try_sum expression because DataFusion might not have it.
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.
yeah, so I just went ahead and create an issue to track this one: #280.
….scala Co-authored-by: advancedxy <[email protected]>
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.
LGTM. Thanks for the fix!
There are some format issues that need to be fixed. |
I'd need one committer approval to merge this. 🙂 |
Thank you @sunchao 😄 |
Merged. Thanks @huaxingao @sunchao @advancedxy |
…che#277) * fix: Comet should not translate try_sum to native sum expression * For Spark 3.2 and 3.3 * Update spark/src/main/scala/org/apache/comet/shims/ShimQueryPlanSerde.scala Co-authored-by: advancedxy <[email protected]> * Fix format --------- Co-authored-by: advancedxy <[email protected]>
Which issue does this PR close?
Closes #276.
Rationale for this change
What changes are included in this PR?
How are these changes tested?