Skip to content

Resolve scalar and aggregate UDF overloads by arity - #91

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
udf-udaf-overload-by-arity
Sep 14, 2026
Merged

osipovartem merged 1 commit into
embucket-sync-df55.0.0from
udf-udaf-overload-by-arity

Conversation

@osipovartem

Copy link
Copy Markdown
Collaborator

Summary

  • expose exact argument-count matching for TypeSignature
  • fall through from a same-name scalar UDF to a UDAF when only the aggregate signature supports the call arity
  • preserve existing scalar-UDF precedence when both functions support the same arity

This enables Snowflake-compatible functions such as ST_COLLECT, which has both a two-argument scalar form and a one-argument aggregate form. Resolution happens once during SQL planning and adds no per-row execution overhead.

Validation

  • cargo +1.95.0 test -p datafusion-expr-common (165 unit tests and 11 doc tests)
  • cargo +1.95.0 test -p datafusion-sql --test sql_integration (609 tests)
  • cargo +1.95.0 clippy -p datafusion-sql -p datafusion-expr-common --all-targets -- -D warnings

@osipovartem
osipovartem merged commit d8fc930 into embucket-sync-df55.0.0 Sep 14, 2026
17 of 19 checks passed
@osipovartem
osipovartem deleted the udf-udaf-overload-by-arity branch September 14, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant