fix: derive custom nullability for spark map_from_arrays#19275
Merged
comphead merged 1 commit intoapache:mainfrom Dec 12, 2025
Merged
fix: derive custom nullability for spark map_from_arrays#19275comphead merged 1 commit intoapache:mainfrom
map_from_arrays#19275comphead merged 1 commit intoapache:mainfrom
Conversation
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 2, 2026
## Which issue does this PR close? - Closes #19870. ## 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: #19275). ## Are these changes tested? Covered by existing information_schema sqllogictests and `datafusion-functions` unit tests. ## Are there any user-facing changes? No.
de-bgunter
pushed a commit
to de-bgunter/datafusion
that referenced
this pull request
Mar 24, 2026
…he#20079) ## Which issue does this PR close? - Closes apache#19870. ## 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: apache#19275). ## Are these changes tested? Covered by existing information_schema sqllogictests and `datafusion-functions` unit tests. ## Are there any user-facing changes? No.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
map_from_arraysneed to have custom nullability #19160Rationale for this change
What changes are included in this PR?
map_from_arraysnow usesreturn_field_from_argsto handle nullabilityAre these changes tested?
Are there any user-facing changes?