Commit 8d15d3a
committed
Add list_transform expression
Adds a ListTransform scalar fn implementing DuckDB-style list_transform(l,
lambda x: ...) as a Vortex expression. The lambda body is an ordinary
Expression stored in the fn's options, evaluated with the list's elements
array as its root scope (root() inside the body refers to the element).
Execution rewraps the list structure around a deferred apply() of the body
to the elements child, so offsets and list validity pass through untouched
and no element values are computed eagerly.
Includes:
- identity (body == root) and fusion (transform-of-transform) rewrites in
simplify_untyped, plus list_length(list_transform(l, f)) -> list_length(l)
- proto serde of the options-embedded body via the session registry
- fallibility delegation to the body, since generic tree walks cannot see
options-embedded expressions
- design doc under scalar_fn/fns/list_transform/design.md
Signed-off-by: Matt Katz <mhkatz97@gmail.com>1 parent 1743bb0 commit 8d15d3a
6 files changed
Lines changed: 1041 additions & 1 deletion
File tree
- vortex-array/src
- expr
- scalar_fn
- fns
- list_transform
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
765 | 767 | | |
766 | 768 | | |
767 | 769 | | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
173 | 188 | | |
174 | 189 | | |
175 | 190 | | |
176 | | - | |
| 191 | + | |
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
| |||
0 commit comments