amitvijapur commented on PR #23898: URL: https://github.com/apache/datafusion/pull/23898#issuecomment-5603695583
Heads up @andygrove — this now conflicts with main, and #24409 landing is the cause, so apologies for the extra work. I test-merged it against current main (76 commits behind). Conflicts in `datafusion/spark/src/function/math/modulus.rs` and `datafusion/sqllogictest/test_files/spark/math/pmod.slt`. The two changes look complementary rather than overlapping. #24409 added `pmod_decimal_result_type` (Spark's `Remainder` rule for the decimal result type) plus null passthrough for the uncoerced `DataType::Null` that `Coercible` lets through, per #19458. This PR adds the ANSI zero-divisor raise masked by dividend validity, `is_negative` with `-0.0` handling, and the Java integer-promotion arithmetic. Nothing in one subsumes the other. **One thing worth watching in the resolution.** This PR uses `add_wrapping` deliberately, so `pmod(-1, -2147483648)` yields `2147483647` the way Spark does. Main now imports plain `arrow::compute::kernels::numeric::add` and calls it at `modulus.rs:172`. A resolution that takes main's import block wholesale drops the wrapping behaviour, and I don't think any existing test catches that, so it would go silently. The `Int8`/`Int16` widening to `Int32` has the same property. The other two conflicts are mechanical: the import block, and `is_negative` versus `pmod_decimal_result_type` landing at the same insertion point. Happy to push the rebase myself if that's useful, since my PR caused it — just say the word and I'll open it against your branch. Otherwise this is just a flag. Disclosure: written with AI assistance, reviewed by me before posting. -- 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]
