hareshkh opened a new pull request, #447: URL: https://github.com/apache/datafusion-spark/pull/447
## Which issue does this PR close? - None. Found while checking `pmod` and `mod` against Spark 4.2.0. ## Rationale for this change `mod` of two decimals returns their common decimal type, where Spark returns `Remainder.resultDecimalType`. For example `mod(CAST(-7 AS decimal(3,0)), CAST(2.5 AS decimal(10,2)))` is `decimal(10,2)` here and `decimal(5,2)` in Spark. `pmod` already applies this rule. ## What changes are included in this PR? `mod` now uses `pmod`'s signature and result type, through helpers the two share. `spark_mod` keeps its signature and derives the result type from its arguments. ## Are these changes tested? Yes, new cases in `math/mod.slt` for scalars, arrays, mixed scales, NULLs and zero divisors, with ANSI on and off. The `arrow_typeof` cases fail on `main`. I checked every expected result against Spark 4.2.0, the types with `typeof` because the PySpark runner skips `arrow_typeof`. The runner reports no differences for `mod.slt` and `pmod.slt`. ## Are there any user-facing changes? `mod` of two decimals returns Spark's result type. No API changes. -- 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]
