Omega359 commented on issue #17970:
URL: https://github.com/apache/datafusion/issues/17970#issuecomment-3386346566

   The initial string -> number conversion I think is handled in the sql module 
- 
https://github.com/apache/datafusion/blob/0f83c1d233499e80fd9b0baf89dd624099c1d1ba/datafusion/sql/src/expr/value.rs#L72
   
   The max u64 value in Rust is 
[18446744073709551615](https://doc.rust-lang.org/std/primitive.u64.html#associatedconstant.MAX)
 which is being cast to uint64 in the function referenced above. Otherwise, 
it's being converted to float unless you have the 
[SqlParserOptions.parse_float_as_decimal](https://github.com/apache/datafusion/blob/980c948d8a6343d061058afd1596ece29ea25a83/datafusion/common/src/config.rs#L249)
 option set to true (default is false)
   
   As to why it's non-deterministic with float, 🤷🏻‍♂️ If there is type coercion 
happening between the `Decimal256(65, 0))` type and `Float64` it's probably 
somewhere in the [binary type 
converter](https://github.com/apache/datafusion/blob/032117adfc03d65a1245087ed03ef7b1998129ed/datafusion/expr-common/src/type_coercion/binary.rs#L972)


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