Repository navigation
Split the Binary scalar function into Compare, Boolean, and Numeric - #11818
Open
robert3005 wants to merge 2 commits into
Open
robert3005 wants to merge 2 commits into
robert3005 wants to merge 2 commits into
Conversation
`Binary` held comparison, Kleene boolean, and arithmetic operators behind one `Operator` enum, so each caller had to match on the operator to learn the kind of function. There are now three functions, each with its own operator type: `Compare` (`vortex.compare`), `Boolean` (`vortex.boolean`), and `Numeric` (`vortex.numeric`). Expressions that an older version serialized as `vortex.binary` still load. A legacy plugin reads `BinaryOpts` and returns the function that now owns the operator. Signed-off-by: Robert Kruszewski <github@robertk.io>
Merging this PR will degrade performance by 48.23%1 warning
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Signed-off-by: Robert Kruszewski <github@robertk.io>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Binaryheld comparison, Kleene boolean, and arithmetic operators behind oneOperatorenum, so each kernel, rule, and integration had to match on the operator to learn which kind of function it had. Options that apply to only one kind, such as the float order of a comparison in #11401, had no clean place. There are now three functions, each with its own operator type:Compare(vortex.compare,CompareOperator),Boolean(vortex.boolean,BooleanOperator), andNumeric(vortex.numeric,NumericOperator).Most of the diff is mechanical. The parts to review are the three vtables in
vortex-array/src/scalar_fn/builtin/{compare,boolean,numeric}/mod.rs, the legacy reader inbuiltin/binary.rs, and the stats rewrite rules invortex-expr, where the twoBinaryrules became one pair forCompareand one pair forBoolean.Breaking changes:
Binary, the mixedOperatorenum,ArrayBuiltins::binary,ExprBuiltins::binary,expr::binary,expr::bound::binary, and the module pathscalar_fn::builtin::binaryare removed. Usecompare,boolean, andnumericin their place. Kernel traits are now inbuiltin::compareandbuiltin::boolean, andBooleanKernel::booleantakes aBooleanOperator.vortex.binarystill loads: a legacy plugin readsBinaryOptsand returns the function that now owns the operator. An older Vortex version cannot read an expression that this version writes.NumericOperatornow displays as+,-,*,/, asOperatordid.The C, Java, and Python operator surfaces do not change. A new test checks that each of the 12 legacy operators loads as the correct function.
vortex-cudaandvortex-python-cudawere not compiled locally, and the Java tests were not run.🤖 Generated with Claude Code