peterxcli commented on code in PR #5044:
URL: https://github.com/apache/datafusion-comet/pull/5044#discussion_r3691741455
##########
native/spark-expr/src/math_funcs/wide_decimal_binary_expr.rs:
##########
@@ -281,7 +281,13 @@ impl PhysicalExpr for WideDecimalBinaryExpr {
}
};
- let result = if eval_mode != EvalMode::Ansi {
+ let result = if eval_mode != EvalMode::Ansi &&
result.values().contains(&i128::MAX) {
+ // The arithmetic pass writes i128::MAX as an overflow sentinel
for values that do
+ // not fit the output precision. Only when a sentinel is present
do we need the
+ // extra null-masking pass (which allocates a new array);
`contains` short-circuits
+ // at the first sentinel, so the common no-overflow case skips
that allocation
+ // entirely. ANSI mode raises on overflow and never produces a
sentinel, so it also
+ // skips this pass.
Review Comment:
I change this to follow your direction:
https://github.com/apache/datafusion-comet/pull/5044#discussion_r3691138122, so
this no longer a problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]