AdamGS opened a new pull request, #17759:
URL: https://github.com/apache/datafusion/pull/17759

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Closes #17747
   
   ## Rationale for this change
   
   Fills out support for more the new smaller decimal types.
   
   ## What changes are included in this PR?
   
   1. Fills out coercion between various decimal types for binary operations 
(comparison and arithmetic)
   2. Support for the `abs` function
   3. Support for sorted merge join (including for Decimal256, which I'm not 
sure if it was omitted before or explicitly unsupported).
   4. Support for decimal32/64 in the slt engine
   
   ## Are these changes tested?
   
   Yes, both new dedicated rust tests and additional dedicated SLT tests, in 
addition to existing functionality.
   
   ## Are there any user-facing changes?
   
   Yes - there are a few major user-facing changes:
   1. Tables or values casted to decimal types with an appropriate precision, 
will now be a smaller decimal type.
   2. In some cases - failure to coerce a type might result in a significant 
change. For example - the spark slt tests including the following test:
   ```sql
   SELECT MOD(2::int, 1.8::decimal(2,1));
   ```
   before this PR, that test returned a 0.2 with a datatype of `Decimal128(2, 
1)`. With this PR, this exact statement returns `0` with a datatype of `Int32`, 
because it actually can't coerce a `Int32` to a `Decimal32(2, 1)`.
   Should it fall-back to floating point types? Some wide-enough predetermined 
decimal variant? I didn't debug this path fully yet, so the answer potentially 
hides somewhere there.
   
   Either way - the second breaking change seems to be the biggest open issue I 
have in this PR, once there's consensus on the desired behavior here, fixing 
the code and tests appropriately is the easy part.
   
   


-- 
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]

Reply via email to