alamb commented on issue #957: URL: https://github.com/apache/arrow-datafusion/issues/957#issuecomment-946173074
> That code declares which type coercions are available, but, maybe I'm missing something, I don't see any rule that states which numeric type should be chosen to coerce strings or the actual code to convert them from utf8 to numeric. The arrow cast kernel https://docs.rs/arrow/6.0.0/arrow/compute/kernels/cast/index.html contains the code to covert `utf8` to many differnet types -- see https://github.com/apache/arrow-rs/blob/master/arrow/src/compute/kernels/cast.rs I think the issue that is described on this bug is that by desigh DF won't auto cast (coerce) in a way that loses data (so it won't coerce `1.2` to an int because it loses precision (aka loses the .2)). However, if the user explicitly says `CAST(col as INT)` the idea is that they are specifying the behavior and thus DataFusion should truncate them correctly -- 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]
