Jefffrey commented on code in PR #19518:
URL: https://github.com/apache/datafusion/pull/19518#discussion_r2649559881


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -323,69 +339,15 @@ fn get_valid_types_with_scalar_udf(
 
             // Every signature failed, return the joined error
             if res.is_empty() {
-                internal_err!(
+                return internal_err!(
                     "Function '{}' failed to match any signature, errors: {}",
                     func.name(),
                     errors.join(",")
-                )
+                );
             } else {
-                Ok(res)
+                res
             }
         }
-        _ => get_valid_types(func.name(), signature, current_types),
-    }
-}
-
-fn get_valid_types_with_aggregate_udf(
-    signature: &TypeSignature,
-    current_types: &[DataType],
-    func: &AggregateUDF,
-) -> Result<Vec<Vec<DataType>>> {
-    let valid_types = match signature {
-        TypeSignature::UserDefined => match func.coerce_types(current_types) {
-            Ok(coerced_types) => vec![coerced_types],
-            Err(e) => {
-                return exec_err!(
-                    "Function '{}' user-defined coercion failed with {:?}",
-                    func.name(),
-                    e.strip_backtrace()
-                );
-            }
-        },
-        TypeSignature::OneOf(signatures) => signatures

Review Comment:
   The scalar fn version actually has extra functionality in that it collects 
the errors together for oneof; unifying this code with aggregate/window udfs 
brings in this functionality for them, hence SLT fix was needed



-- 
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]

Reply via email to