Skip to content

Conversation

@AndreaBozzo
Copy link

Which issue does this PR close?

Rationale for this change

Some UDFs/UDAFs implement return_field_from_args / return_field instead of return_type. The information schema was calling return_type directly, which fails for those functions. The default implementation of return_field_from_args already delegates to return_type, so switching to the newer API works for all functions.

What changes are included in this PR?

  • information_schema.rs: get_udf_args_and_return_types now calls return_field_from_args instead of return_type; get_udaf_args_and_return_types now calls return_field instead of return_type. Removed stale comments referencing the old API.
  • date_trunc.rs: return_type now returns internal_err, and return_field_from_args is self-contained (no longer delegates to return_type), following the same pattern as other UDFs like named_struct and map_from_arrays (ref: fix: derive custom nullability for spark map_from_arrays #19275).

Are these changes tested?

Covered by existing information_schema sqllogictests and datafusion-functions unit tests.

Are there any user-facing changes?

No.

@github-actions github-actions bot added catalog Related to the catalog crate functions Changes to functions implementation labels Jan 30, 2026
@AndreaBozzo AndreaBozzo marked this pull request as ready for review January 30, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

catalog Related to the catalog crate functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Information schema should use return_field_from_args

1 participant