choplin commented on code in PR #23063:
URL: https://github.com/apache/datafusion/pull/23063#discussion_r3550126661
##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -549,13 +549,13 @@ impl ExprSchemable for Expr {
match fun {
WindowFunctionDefinition::AggregateUDF(udaf) => {
let new_fields =
- verify_function_arguments(udaf.as_ref(), &fields)?;
+ verify_function_arguments(udaf.as_ref(), &fields,
None)?;
Review Comment:
Thanks! Fixed in c8a44313a.
WindowFunction now carries a spans field (mirroring `ScalarFunction` /
`AggregateFunction`). `SqlToRel` populates it from the function-call token when
`collect_spans` is enabled, and both the `AggregateUDF` and `WindowUDF` window
branches now pass `spans.first()` into `verify_function_arguments` instead of
None, so `sum(first_name) OVER ()` and window-UDF calls point at the SQL call
site.
Added `test_invalid_window_function_argument_types` based on your example
`(sum(first_name) OVER ())`, asserting the diagnostic points at the sum call
site.
--
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]