feat[expr]: N-ary CASE WHEN expression#6786
Merged
robert3005 merged 7 commits intovortex-data:developfrom Mar 4, 2026
Merged
Conversation
…13) * feat: implement binary CASE WHEN expression with support for nested conditions
…and support for nullable ELSE
…nd enhancing child expression handling
Signed-off-by: Luke Kim <80174+lukekim@users.noreply.github.com>
…ub.com> I, Luke Kim <80174+lukekim@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 9538417 I, Luke Kim <80174+lukekim@users.noreply.github.com>, hereby add my Signed-off-by to this commit: c648553 I, Luke Kim <80174+lukekim@users.noreply.github.com>, hereby add my Signed-off-by to this commit: c897c84 I, Luke Kim <80174+lukekim@users.noreply.github.com>, hereby add my Signed-off-by to this commit: af601cd I, Luke Kim <80174+lukekim@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 929d7b3 Signed-off-by: Luke Kim <80174+lukekim@users.noreply.github.com>
robert3005
approved these changes
Mar 4, 2026
Contributor
robert3005
left a comment
There was a problem hiding this comment.
In order to retain Luke's contribution attribution we will merge this and then fix one small bug that we had on the original pr
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.
Summary
Introduces CASE WHEN expression support in Vortex as a scalar function, implementing a true n-ary CASE WHEN cond1 THEN val1 WHEN cond2 THEN val2 ... ELSE default END expression.
Changes included
This pull request introduces support for SQL-style CASE WHEN expressions in Vortex, including both the expression logic and integration with DataFusion. The changes add new expression constructors, conversion logic, and pushdown support for CASE WHEN, as well as comprehensive benchmarks and tests to ensure correctness and performance.
CASE WHEN expression support:
case_when,case_when_no_else, andnested_case_whento build CASE WHEN expressions inexprs.rs, leveraging the newCaseWhenscalar function and its options. [1] [2]CaseWhenOptsprotobuf message to encode CASE WHEN options for serialization.case_whenscalar function module.DataFusion integration:
CaseExprto Vortex's CASE WHEN expressions, supporting the "searched CASE" form and mapping WHEN/THEN/ELSE clauses. [1] [2]Benchmarking and testing:
case_when_bench.rsand registered them inCargo.toml. [1] [2]Other improvements:
Testing
CASE WHENexpression applied to an ArrowRecordBatch.Benchmarking
CASE WHENscenarios, including simple, nested, all-true, and all-false cases, inbenches/expr/case_when_bench.rs, and registered it inCargo.toml. [1] [2]