Commit 4f802b6
Lazy array expression evaluation (#5625)
This long-lived feature branch contain changes required for the
"operators RFC", "Lazy Arrays", whatever we're calling it.
The change is hidden behind the `VORTEX_OPERATORS=true` environment
variable allowing us to run parallel benchmarks until we reach parity
between legacy compute function dispatch and the new optimizer rules
framework.
Summary of changes:
* Rename `execute` -> `execute_vector`, add similar `execute_mask`
function. This pattern will be used when turning a Vortex Array into
concrete physical data via whatever means, e.g. `execute_arrow`,
`execute_duckdb`, and so on.
* Introduces `trait Kernel` to represent a physical tree of CPU-based
vector execution
* `Array::batch_execute -> Array::bind_kernel`
* Implements ScalarFnArray execution using a ScalarFnKernel, binding
constant children to scalar datum inputs for the ScalarFn.
* Reverts the change to pull out a `ScalarFnVTable`, in favor of
allowing all `expr::VTable` to be used as scalar functions. This
provides a smoother migration for end-users, at the expense of having to
special-case the `root` expression during execution.
* Expression now holds ScalarFn instance (vtable + options), as well as
children.
* Removes `ExpressionView`, easier to pass separate Expression + options
into vtable.
* `expr::VTable::execute` takes arguments by ownership.
* Implements all `expr::VTable::execute` functions.
* Adds `Array::filter` to vtable, providing an O(1) function for masking
arrays. Fallback is to wrap up the child in a FilterArray.
* Adds `Datum::ensure_vector` and fleshes out `Scalar::repeat`
implementations.
* Fixes expression display to not use debug formatting of options.
* Removes untyped simplification, it was never called.
* Removes ExprOptimizer in favor of a simple reduce_child
`Expr::simplify` function. Complex reduction rules can be implemented
over the array tree only to avoid duplication.
* Introduces `Array::apply(&Expression)` to turn expressions into
arrays. This function is the new API that will live in vortex-array and
allow us to invert the expr -> array dependency to become array -> expr.
---------
Signed-off-by: Nicholas Gates <[email protected]>
Signed-off-by: Siddharth Kumar <[email protected]>
Co-authored-by: Alfonso Subiotto Marqués <[email protected]>
Co-authored-by: Baris Palaska <[email protected]>
Co-authored-by: sherlockbeard <[email protected]>
Co-authored-by: Connor Tsui <[email protected]>1 parent ba0e97a commit 4f802b6
File tree
173 files changed
+5410
-5707
lines changed- encodings
- alp/src/alp
- fastlanes/src/bitpacking
- array
- vtable
- runend
- src
- sequence/src
- vortex-array/src
- arrays
- bool/vtable
- chunked/vtable
- constant
- vtable
- decimal/vtable
- extension/vtable
- filter
- fixed_size_list/vtable
- listview/vtable
- masked/vtable
- null
- primitive/vtable
- scalar_fn
- vtable
- struct_
- vtable
- varbinview/vtable
- array
- compute
- execution
- expr
- analysis
- exprs
- get_item
- merge
- select
- forms
- functions
- session
- transform
- traversal
- kernel
- optimizer
- scalar_fns
- binary
- cast
- get_item
- is_null
- mask
- not
- session
- vtable
- vortex-compute
- src
- arrow
- comparison
- vortex-datafusion/src/convert
- vortex-duckdb/src/convert
- vortex-file/src
- vortex-io/src/runtime
- vortex-layout
- src/layouts
- dict
- flat
- row_idx
- struct_
- zoned
- vortex-mask
- src
- vortex-scalar/src
- vortex-scan/src
- vortex-vector/src
- binaryview
- bool
- decimal
- fixed_size_list
- listview
- primitive
- struct_
- vortex/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
173 files changed
+5410
-5707
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | | - | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
165 | 182 | | |
166 | 183 | | |
167 | 184 | | |
| |||
456 | 473 | | |
457 | 474 | | |
458 | 475 | | |
| 476 | + | |
459 | 477 | | |
| 478 | + | |
460 | 479 | | |
461 | 480 | | |
462 | 481 | | |
463 | 482 | | |
464 | 483 | | |
465 | 484 | | |
466 | 485 | | |
467 | | - | |
| 486 | + | |
| 487 | + | |
468 | 488 | | |
469 | 489 | | |
470 | 490 | | |
| |||
480 | 500 | | |
481 | 501 | | |
482 | 502 | | |
483 | | - | |
| 503 | + | |
484 | 504 | | |
485 | 505 | | |
486 | 506 | | |
| |||
504 | 524 | | |
505 | 525 | | |
506 | 526 | | |
507 | | - | |
| 527 | + | |
508 | 528 | | |
509 | 529 | | |
510 | 530 | | |
| |||
534 | 554 | | |
535 | 555 | | |
536 | 556 | | |
537 | | - | |
| 557 | + | |
538 | 558 | | |
539 | 559 | | |
540 | 560 | | |
| |||
562 | 582 | | |
563 | 583 | | |
564 | 584 | | |
565 | | - | |
| 585 | + | |
566 | 586 | | |
567 | 587 | | |
568 | 588 | | |
| |||
601 | 621 | | |
602 | 622 | | |
603 | 623 | | |
604 | | - | |
| 624 | + | |
605 | 625 | | |
606 | 626 | | |
607 | 627 | | |
| |||
643 | 663 | | |
644 | 664 | | |
645 | 665 | | |
646 | | - | |
| 666 | + | |
647 | 667 | | |
648 | 668 | | |
649 | 669 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
539 | | - | |
| 540 | + | |
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
| |||
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
559 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
560 | 564 | | |
561 | 565 | | |
562 | 566 | | |
| |||
593 | 597 | | |
594 | 598 | | |
595 | 599 | | |
596 | | - | |
| 600 | + | |
597 | 601 | | |
598 | 602 | | |
599 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
0 commit comments