rich7420 commented on code in PR #7456:
URL: https://github.com/apache/datafusion-comet/pull/7456#discussion_r4707090407
##########
native/spark-expr/src/conditional_funcs/case_when.rs:
##########
@@ -467,6 +476,26 @@ fn infallible(expr: &Arc<dyn PhysicalExpr>, input_schema:
&Schema, parsing: bool
} else {
cast.is_infallible(input_schema)
}
+ } else if let Some(check) = expr.downcast_ref::<CheckOverflow>() {
+ // Without `fail_on_error` a decimal that overflows the precision
becomes NULL
+ parsing
+ && !check.fail_on_error
+ && matches!(check.data_type, DataType::Decimal128(_, _))
+ && matches!(
+ check.child.data_type(input_schema),
+ Ok(DataType::Decimal128(_, _))
+ )
+ } else if let Some(function) = expr.downcast_ref::<ScalarFunctionExpr>() {
+ // Named as the planner names the functions it builds from Spark's, in
+ // `create_scalar_function_expr`
+ parsing && STRING_FUNCTIONS_THAT_CANNOT_FAIL.contains(&function.name())
Review Comment:
Sounds good to me, thanks! The int-to-decimal and to-string casts added to
`Cast::cannot_fail` reach AND/OR the same way, so they'd need the same split.
--
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]