You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "oleggator (via GitHub)" <gi...@apache.org> on 2024/08/08 12:54:09 UTC

[I] Float to int cast behaviour [datafusion]

oleggator opened a new issue, #11886:
URL: https://github.com/apache/datafusion/issues/11886

   At the moment, DataFusion casts floats to integers using the floor function.
   Is it possible to configure this behavior?
   
   ## Actual
   ```
   select cast(2.8 as int) as result;
   +--------+
   | result |
   +--------+
   | 2      |
   +--------+
   ```
   
   ## Expected
   This way work Postgresql and MySQL.
   ```
   select cast(2.8 as int) as result;
   +--------+
   | result |
   +--------+
   | 3      |
   +--------+
   ```


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Float to int cast behaviour [datafusion]

Posted by "jayzhan211 (via GitHub)" <gi...@apache.org>.
jayzhan211 commented on issue #11886:
URL: https://github.com/apache/datafusion/issues/11886#issuecomment-2275937010

   I think we would need to support configuration in arrow-rs first. The actual casting is here https://github.com/apache/arrow-rs/blob/e28cf44e65cdd1fefaa1b857ca4336e7a9da5d06/arrow-cast/src/cast/mod.rs#L2177


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org