You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3b0d0c8
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: share aggregate return field metadata handling (#27193)
## Which issue does this PR close?
- Closes#27013.
## Rationale for this change
Aggregates that return a value from their first argument need to
preserve that field's metadata, including Arrow extension type metadata.
The same return-field logic is currently implemented separately by
several aggregates, while aggregate-form `nth_value` does not preserve
the metadata.
## What changes are included in this PR?
This adds `udaf_return_field_preserving_arg_metadata` alongside
`udaf_default_return_field` and uses it for `any_value`, `first_value`,
`last_value`, `nth_value`, `min`, and `max`.
## What is the testing strategy for this PR?
The aggregate metadata cases in `metadata.slt` cover all six functions.
The new `nth_value` case specifically exercises aggregate form rather
than the separate window function.
## Are there any user-facing changes?
Yes. This adds the public `udaf_return_field_preserving_arg_metadata`
helper, and aggregate-form `nth_value` now preserves the first
argument's field metadata.
0 commit comments