jonahgao commented on PR #14223: URL: https://github.com/apache/datafusion/pull/14223#issuecomment-2612102948
Some information may be useful: 1. This coercion rule applies to union and comparisons (for example, a > b, a <= b), but does not apply to arithmetic operations (for example, a + b). Comparisons in arrow-rs require that the operands have the same type. 2. Before this PR, we already had similar behavior; for instance, combining `UInt32` and `Int8` would result in `Int64`. This PR extends that behavior to `UInt64`. Without this change, the following queries will fail. ```sh DataFusion CLI v44.0.0 > select 10000000000000000001 > -1; Arrow error: Cast error: Can't cast value 10000000000000000001 to type Int64 > select 10000000000000000001 union select -1; External error: External error: Arrow error: Cast error: Can't cast value 10000000000000000001 to type Int64 # use narrowest datatype > select 10000000000000000001 union select -1::tinyint; External error: External error: Arrow error: Cast error: Can't cast value 10000000000000000001 to type Int64 ``` -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org