getChan commented on code in PR #23807:
URL: https://github.com/apache/datafusion/pull/23807#discussion_r3632161143
##########
datafusion/physical-expr/src/expressions/cast.rs:
##########
@@ -214,8 +214,18 @@ pub(crate) fn cast_expr_properties(
target_type: &DataType,
) -> Result<ExprProperties> {
let unbounded = Interval::make_unbounded(target_type)?;
- if is_order_preserving_cast_family(&child.range.data_type(), target_type) {
- Ok(child.clone().with_range(unbounded))
+ let source_type = child.range.data_type();
+ // A widening cast is additionally one-to-one, so it is strictly
Review Comment:
I may not have full context, so please feel free to ignore this if it's a
misunderstanding.
`CastExpr::check_bigger_cast` includes `Int32 -> Float32` and `Int64 ->
Float64`. Due to float mantissa limits, large integers lose precision and can
collapse to the same float value (e.g. `16_777_216_i32 as f32 == 16_777_217_i32
as f32`), so they are not strictly 1-to-1
--
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]