neilconway commented on PR #20306:
URL: https://github.com/apache/datafusion/pull/20306#issuecomment-3898530434
Digging into this a bit further, this fix seems cleaner to me:
```
diff --git a/datafusion/optimizer/src/analyzer/type_coercion.rs
b/datafusion/optimizer/src/analyzer/type_coercion.rs
index c2121f45c..1a8218a1e 100644
--- a/datafusion/optimizer/src/analyzer/type_coercion.rs
+++ b/datafusion/optimizer/src/analyzer/type_coercion.rs
@@ -954,10 +954,6 @@ fn coerce_arguments_for_signature<F: UDFCoercionExt>(
schema: &DFSchema,
func: &F,
) -> Result<Vec<Expr>> {
- if expressions.is_empty() {
- return Ok(expressions);
- }
-
let current_fields = expressions
.iter()
.map(|e| e.to_field(schema).map(|(_, f)| f))
```
i.e., `coerce_arguments_for_signature()` -> `fields_with_udf()` is *already*
checking for functions that require arguments but that are invoked with no
arguments, but this is effectively dead code because we exit early before we
get there. If we just remove the early-exit then the behavior seems right to
me. What do you think?
--
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]