Stazer opened a new pull request, #24595: URL: https://github.com/apache/datafusion/pull/24595
Which issue does this PR close? - None Rationale for this change select first_value() over () from ... panics the whole process instead of returning a query error (index out of bounds in nth_value.rs). last_value()/nth_value() do the same. In an embedding application this takes down the whole process, not just the one query. An exemplary query is `select first_value() over () from (values (1), (2), (3)) as t(x);`. Before the UDWF conversion in #13201, these functions had exact arity (1 arg for first/last, 2 for nth) and a zero-argument call was rejected during planning. The conversion added TypeSignature::Nullary to the signature, letting first_value() pass type checking and reach the evaluator, which unconditionally indexes values[0]. What changes are included in this PR? - Remove Nullary from the signature in nth_value.rs, restoring the pre-#13201 arity (matches lead/lag, which never had it). DataFusion's generic argument-count check now rejects first_value() during planning. - Validate argument count in partition_evaluator() too, matching the early-validation call in create_udwf_window_expr (physical-plan/src/windows/mod.rs). Are these changes tested? Manually verified first_value()/last_value()/nth_value() (with/without ORDER BY) now fail cleanly at planning instead of panicking, and existing unit + window.slt tests still pass. Are there any user-facing changes? Zero-argument calls now error instead of panicking. No valid query is affected. -- 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]
