devanshu0987 commented on PR #20099:
URL: https://github.com/apache/datafusion/pull/20099#issuecomment-3841512100

   > Thanks @devanshu0987 maybe we can also add overflow `slt` tests
   
   Hi @comphead , after check, the situation is following
   
   - floor only accepts `Decimal/Float64/Float32`
   - The result is either `Float64/Float32/Decimal`
   
   ----------
   - Hence, all Ints on the right hand side are coerced to Floats/Decimal. 
Hence, they cannot be tested via SLT tests.
   - For Float precision loss, I have a test case.
   - For Decimal, via SLT/SQL path, all Decimals are either 
`Decimal128`/`Decimal256`
     - As per rules here: 
https://datafusion.apache.org/user-guide/sql/data_types.html#numeric-types
   - Before reaching preimage stage, the Decimal values are validated against 
`MAX_DECIMAL128_FOR_EACH_PRECISION` and `MAX_DECIMAL256_FOR_EACH_PRECISION`
     - They reject `i128:MAX` and `i256:MAX` (which are the only values which 
can overflow by adding 1) before reaching preimage stage.
   - Due to this, Decimal path is not testable via SQL/SLT path. Hence, no SLT 
tests.
   
   Please let me know, if the reasoning is valid. 


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