You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "choplin (via GitHub)" <gi...@apache.org> on 2026/07/09 08:34:27 UTC
Re: [PR] feat: attach Diagnostic to "invalid function argument types" error [datafusion]
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org