alamb commented on code in PR #5117:
URL: https://github.com/apache/arrow-datafusion/pull/5117#discussion_r1092091280
##########
datafusion/optimizer/src/type_coercion.rs:
##########
@@ -553,10 +553,22 @@ fn coerce_arguments_for_signature(
expressions
.iter()
.enumerate()
- .map(|(i, expr)| expr.clone().cast_to(&new_types[i], schema))
+ .map(|(i, expr)| cast_expr(expr, &new_types[i], schema))
.collect::<Result<Vec<_>>>()
}
+/// Cast `expr` to the specified type, if possible
+fn cast_expr(expr: &Expr, to_type: &DataType, schema: &DFSchema) ->
Result<Expr> {
+ // Special case until Interval coercion is handled in arrow-rs
+ // https://github.com/apache/arrow-rs/issues/3643
+ match (expr, to_type) {
Review Comment:
This only supports literals at the moment -- tracked
https://github.com/apache/arrow-rs/issues/3643 for the more general case of
coercing columns
--
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]