izveigor commented on code in PR #7338:
URL: https://github.com/apache/arrow-datafusion/pull/7338#discussion_r1308288920
##########
datafusion/optimizer/src/analyzer/type_coercion.rs:
##########
@@ -581,48 +773,22 @@ fn coerce_arguments_for_fun(
.collect::<Result<Vec<_>>>()?;
}
- if *fun == BuiltinScalarFunction::MakeArray {
- // Find the final data type for the function arguments
- let current_types = expressions
- .iter()
- .map(|e| e.get_type(schema))
- .collect::<Result<Vec<_>>>()?;
-
- let new_type = current_types
- .iter()
- .skip(1)
- .fold(current_types.first().unwrap().clone(), |acc, x| {
- comparison_coercion(&acc, x).unwrap_or(acc)
- });
-
- return expressions
- .iter()
- .zip(current_types)
- .map(|(expr, from_type)| cast_array_expr(expr, &from_type,
&new_type, schema))
- .collect();
+ match fun {
Review Comment:
I am inclined to solve this problem by expanding signature's structure
because there is one difficulty with User Defined Function. For example, I am
Arrow DataFusion's user and I want to define my own `ArrayAppend`
implementation (the function `new_array_append`). And how this function would
handle nulls?
What do you think about it, @alamb and @jayzhan211?
--
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]