Skip to content

Commit 05d6b1a

Browse files
committed
feat: add array_first higher-order array function
Add `array_first(array, predicate)`, a higher-order function that returns the first element of an array for which the lambda predicate returns true. It returns null when the array is empty or no element matches; a predicate that returns null for an element is treated as not matching, and a matched null element is returned as null. Implemented as a `HigherOrderUDFImpl` alongside the existing array lambda functions (`array_any_match`, `array_filter`, `array_transform`), with `list_first` as an alias. Includes unit tests, sqllogictest coverage, and generated documentation.
1 parent d302350 commit 05d6b1a

4 files changed

Lines changed: 582 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)