Jefffrey commented on code in PR #24409: URL: https://github.com/apache/datafusion/pull/24409#discussion_r3944516360
########## datafusion/sqllogictest/test_files/spark/math/pmod.slt: ########## @@ -128,6 +132,35 @@ SELECT pmod(NULL::int, NULL::int) as pmod_null_3; ---- NULL +# An untyped NULL matches the decimal signature and is passed through +# uncoerced (apache/datafusion#19458), so these types are decided explicitly +# rather than by coercion. `mod` answers Float64 for two untyped nulls and +# keeps the other side's type when only one is null; pmod matches it. +query T +SELECT arrow_typeof(pmod(NULL, NULL)); +---- +Float64 + +query R +SELECT pmod(NULL, NULL); +---- +NULL + +query T +SELECT arrow_typeof(pmod(2.5::decimal(3,1), NULL)); +---- +Decimal128(3, 1) + +query R +SELECT pmod(2.5::decimal(3,1), NULL); +---- +NULL + +# An untyped NULL beside a typed non-decimal argument takes the Numeric path, +# which cannot coerce the pair. `mod` rejects it the same way. +statement error DataFusion error: Error during planning: Internal error: Function 'pmod' failed to match any signature +SELECT pmod(NULL, 3::int); Review Comment: - should be resolved by https://github.com/apache/datafusion/pull/24988 -- 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]
