peterxcli opened a new issue, #5309: URL: https://github.com/apache/datafusion-comet/issues/5309
### What is the problem the feature request solves? #5044 records overflow during `WideDecimalBinaryExpr` evaluation with a `Cell<bool>`, allowing no-overflow batches to skip `null_if_overflow_precision`. Overflowing batches still write an `i128::MAX` sentinel and then run the allocating null-masking pass. Review benchmarks show that the common no-overflow path improves by 10% to 13%, but sparse overflow is 1.6% slower, dense overflow is 5.0% slower, and overflow at the end of the batch is 3.7% slower. Passing `&Cell<bool>` into the `try_binary` closure may inhibit optimization of the kernel loop, while the overflow path still pays for the masking pass. ### Describe the potential solution Write the null validity bit directly when overflow is detected, eliminating the sentinel, `Cell<bool>`, and follow-up masking pass. Preserve the existing behavior: - LEGACY and TRY overflow returns null. - ANSI overflow returns an error. - Scalar × Scalar evaluation returns a null `Decimal128` scalar. - Existing input nulls remain null. Benchmark no-overflow, sparse-overflow, dense-overflow, and last-row-overflow shapes against #5044. ### Additional context This is a follow-up to #5044. The corresponding `DecimalRescaleCheckOverflow` cleanup is tracked separately in #5094. -- 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]
