Repository navigation
Move remaining expressions out of vortex-array to vortex-expr - #10768
robert3005 wants to merge 2 commits into
Conversation
Expressions are about to move out of vortex-array into vortex-expr, which means vortex-functions (whose scalar functions construct expressions) has to sit above vortex-expr rather than below it. This commit flips the dependency without moving the expression types yet: - `select` returns to vortex-array's core builtins. The field-path analyses in vortex-expr (`referenced_field_paths`, immediate access) narrow through it alongside `get_item`, so it is part of the projection machinery those analyses are built on, like `get_item` and `pack`. - `StatFn` moves from vortex-functions into `vortex_expr::stats::stat_fn`, registered by the new `vortex_expr::initialize`. - The stats rewrite rules for `between`, `is_nan`, `like`, `list_contains` and `dynamic` move into `vortex_functions::pruning`, registered by `vortex_functions::initialize`. The shared pieces they build on (stat references, NaN guards, literal and cast stat folding) become the public `vortex_expr::stats::rewrite::helpers` module. - `find_between` moves next to the `between` function it targets. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ps4mp7KF5c4p66aoSoXx5j Signed-off-by: Claude <noreply@anthropic.com>
Unbound `Expression`, binding, traversal, lambdas, proto serialization and the expression constructors now live in `vortex-expr`; `vortex-array` keeps arrays, the scalar function machinery, the builtins it is built on, and `BoundExpression` with its reduce node and optimizer. The scalar function vtable reduces over bound expressions, so keeping them next to it lets every reduction rule stay monomorphized for expression trees as well as array trees. `vortex-expr` re-exports `BoundExpression`. The layering is `vortex-array -> vortex-expr -> vortex-functions`. - `ScalarFnVTable::simplify` is generic over `ReduceNode`, like `reduce`, but stays a separate hook that only the expression optimizer applies: a simplification may rewrite a node into one whose nullability differs, which the array optimizer cannot accept (it must keep the exact dtype and defer constant masks to the kernel rules). `ReduceNode::is_same` lets rules such as the COALESCE rewrite compare operands. - `new_expr`, `try_new_expr` and `try_new_bound_expr` move to `vortex_expr::ScalarFnExprExt`, `ArrayRef::apply`/`apply_bound` to `vortex_expr::ArrayExprExt`, and the expression half of the builtins to `vortex_expr::ExprBuiltins`. `ExprDisplay` moves to `vortex_array::scalar_fn::display`, and the tree renderer to `vortex_array::expr::display`. - `ArrayRef::take_slot_unchecked`/`put_slot_unchecked` become public, like `with_slots`, so row-count substitution in `vortex-expr` still rewrites lazy arrays in place. `vortex_array::expr` otherwise keeps only `stats`, which moves with the aggregate split. The core builtins' expression-level tests move to `vortex-expr`; the few array-level tests that used expressions now go through `ArrayBuiltins`. The `expr_*` benches move to `vortex-expr`, which joins the CodSpeed shard that builds `vortex-functions`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ps4mp7KF5c4p66aoSoXx5j Signed-off-by: Claude <noreply@anthropic.com>
d195163 to
b691d5a
Compare
Merging this PR will degrade performance by 0.54%4 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
after #10762 we can further split expressions into vortex-expr. We flip dependency order into vortex-array → vortex-expr → vortex-functions.