Skip to content

Commit df23c37

Browse files
authored
feat[expr]: N-ary CASE WHEN expression (vortex-data#6786)
## 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:** * Added new constructors `case_when`, `case_when_no_else`, and `nested_case_when` to build CASE WHEN expressions in `exprs.rs`, leveraging the new `CaseWhen` scalar function and its options. [[1]](diffhunk://#diff-d1b532c524303a975ccf98376ed880c0b6e4bab2fce91e99157aac49f9c30e66R24-R25) [[2]](diffhunk://#diff-d1b532c524303a975ccf98376ed880c0b6e4bab2fce91e99157aac49f9c30e66R115-R168) * Introduced `CaseWhenOpts` protobuf message to encode CASE WHEN options for serialization. * Registered the new `case_when` scalar function module. **DataFusion integration:** * Implemented conversion from DataFusion's `CaseExpr` to Vortex's CASE WHEN expressions, supporting the "searched CASE" form and mapping WHEN/THEN/ELSE clauses. [[1]](diffhunk://#diff-ca68b66d97eff4b97ef5e70b3c324078ee441d91422f8d3a426f47882a61a202R148-R186) [[2]](diffhunk://#diff-ca68b66d97eff4b97ef5e70b3c324078ee441d91422f8d3a426f47882a61a202R278-R281) * Enhanced pushdown logic to support CASE WHEN expressions, including recursive checks for child expressions and ELSE clauses. [[1]](diffhunk://#diff-ca68b66d97eff4b97ef5e70b3c324078ee441d91422f8d3a426f47882a61a202L383-R432) [[2]](diffhunk://#diff-ca68b66d97eff4b97ef5e70b3c324078ee441d91422f8d3a426f47882a61a202R445-R510) **Benchmarking and testing:** * Added comprehensive benchmarks for various CASE WHEN scenarios in `case_when_bench.rs` and registered them in `Cargo.toml`. [[1]](diffhunk://#diff-c745f3a7a34d4a4f657c8e2e9e47197ec0f36e2886656366721559f36b76eca9R1-R210) [[2]](diffhunk://#diff-b1d55e82b9c9a25ba02540f4e1d46def7467de866587345f75b63f9ac51c04a6R130-R134) * Added an equivalence test to ensure that DataFusion CASE WHEN results match Vortex's results for the same input data. **Other improvements:** * Refined scalar function pushdown checks and utility logic for expression convertibility. * Minor code quality improvements and error handling in the expression module. ## Testing * Added a comprehensive test to verify equivalence between DataFusion and Vortex results for a `CASE WHEN` expression applied to an Arrow `RecordBatch`. ## Benchmarking * Introduced a new benchmark for various `CASE WHEN` scenarios, including simple, nested, all-true, and all-false cases, in `benches/expr/case_when_bench.rs`, and registered it in `Cargo.toml`. [[1]](diffhunk://#diff-c745f3a7a34d4a4f657c8e2e9e47197ec0f36e2886656366721559f36b76eca9R1-R144) [[2]](diffhunk://#diff-b1d55e82b9c9a25ba02540f4e1d46def7467de866587345f75b63f9ac51c04a6R130-R134) Benchmark | 1K rows | 10K rows | 100K rows -- | -- | -- | -- case_when_simple | 5.4 µs | 8.4 µs | 29.5 µs case_when_without_else | 5.5 µs | 8.7 µs | 29.4 µs case_when_all_true | 4.2 µs | 6.3 µs | 20.7 µs case_when_all_false | 4.3 µs | 6.4 µs | 20.1 µs case_when_nary_3_conditions | 15.1 µs | 25.8 µs | 87.3 µs case_when_nary_equality_lookup (5) | 25.2 µs | 39.7 µs | 125.4 µs case_when_nary_10_conditions | 45.5 µs | 73.1 µs | 257.5 µs --------- Signed-off-by: Luke Kim <80174+lukekim@users.noreply.github.com>
1 parent 4a0f17d commit df23c37

10 files changed

Lines changed: 1572 additions & 5 deletions

File tree

vortex-array/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ name = "expr_large_struct_pack"
127127
path = "benches/expr/large_struct_pack.rs"
128128
harness = false
129129

130+
[[bench]]
131+
name = "expr_case_when"
132+
path = "benches/expr/case_when_bench.rs"
133+
harness = false
134+
130135
[[bench]]
131136
name = "chunked_dict_builder"
132137
harness = false
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3+
4+
#![allow(clippy::unwrap_used)]
5+
#![allow(clippy::cast_possible_truncation)]
6+
7+
use std::sync::LazyLock;
8+
9+
use divan::Bencher;
10+
use vortex_array::ArrayRef;
11+
use vortex_array::Canonical;
12+
use vortex_array::IntoArray;
13+
use vortex_array::VortexSessionExecute;
14+
use vortex_array::arrays::StructArray;
15+
use vortex_array::expr::case_when;
16+
use vortex_array::expr::case_when_no_else;
17+
use vortex_array::expr::eq;
18+
use vortex_array::expr::get_item;
19+
use vortex_array::expr::gt;
20+
use vortex_array::expr::lit;
21+
use vortex_array::expr::nested_case_when;
22+
use vortex_array::expr::root;
23+
use vortex_array::session::ArraySession;
24+
use vortex_buffer::Buffer;
25+
use vortex_session::VortexSession;
26+
27+
static SESSION: LazyLock<VortexSession> =
28+
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());
29+
30+
fn main() {
31+
divan::main();
32+
}
33+
34+
fn make_struct_array(size: usize) -> ArrayRef {
35+
let data: Buffer<i32> = (0..size as i32).collect();
36+
let field = data.into_array();
37+
StructArray::from_fields(&[("value", field)])
38+
.unwrap()
39+
.into_array()
40+
}
41+
42+
/// Benchmark a simple binary CASE WHEN with varying array sizes.
43+
#[divan::bench(args = [1000, 10000, 100000])]
44+
fn case_when_simple(bencher: Bencher, size: usize) {
45+
let array = make_struct_array(size);
46+
47+
// CASE WHEN value > 500 THEN 100 ELSE 0 END
48+
let expr = case_when(
49+
gt(get_item("value", root()), lit(500i32)),
50+
lit(100i32),
51+
lit(0i32),
52+
);
53+
54+
bencher
55+
.with_inputs(|| (&expr, &array))
56+
.bench_refs(|(expr, array)| {
57+
let mut ctx = SESSION.create_execution_ctx();
58+
array
59+
.apply(expr)
60+
.unwrap()
61+
.execute::<Canonical>(&mut ctx)
62+
.unwrap()
63+
});
64+
}
65+
66+
/// Benchmark n-ary CASE WHEN with 3 conditions.
67+
#[divan::bench(args = [1000, 10000, 100000])]
68+
fn case_when_nary_3_conditions(bencher: Bencher, size: usize) {
69+
let array = make_struct_array(size);
70+
71+
// CASE WHEN value > 750 THEN 3 WHEN value > 500 THEN 2 WHEN value > 250 THEN 1 ELSE 0 END
72+
let expr = nested_case_when(
73+
vec![
74+
(gt(get_item("value", root()), lit(750i32)), lit(3i32)),
75+
(gt(get_item("value", root()), lit(500i32)), lit(2i32)),
76+
(gt(get_item("value", root()), lit(250i32)), lit(1i32)),
77+
],
78+
Some(lit(0i32)),
79+
);
80+
81+
bencher
82+
.with_inputs(|| (&expr, &array))
83+
.bench_refs(|(expr, array)| {
84+
let mut ctx = SESSION.create_execution_ctx();
85+
array
86+
.apply(expr)
87+
.unwrap()
88+
.execute::<Canonical>(&mut ctx)
89+
.unwrap()
90+
});
91+
}
92+
93+
/// Benchmark n-ary CASE WHEN with 10 conditions.
94+
#[divan::bench(args = [1000, 10000, 100000])]
95+
fn case_when_nary_10_conditions(bencher: Bencher, size: usize) {
96+
let array = make_struct_array(size);
97+
98+
let pairs: Vec<_> = (0..10)
99+
.map(|i| {
100+
let threshold = (i + 1) * (size as i32 / 10);
101+
(
102+
gt(get_item("value", root()), lit(threshold)),
103+
lit((i + 1) * 100),
104+
)
105+
})
106+
.collect();
107+
let expr = nested_case_when(pairs, Some(lit(0i32)));
108+
109+
bencher
110+
.with_inputs(|| (&expr, &array))
111+
.bench_refs(|(expr, array)| {
112+
let mut ctx = SESSION.create_execution_ctx();
113+
array
114+
.apply(expr)
115+
.unwrap()
116+
.execute::<Canonical>(&mut ctx)
117+
.unwrap()
118+
});
119+
}
120+
121+
/// Benchmark n-ary CASE WHEN with equality conditions (lookup-table style).
122+
#[divan::bench(args = [1000, 10000, 100000])]
123+
fn case_when_nary_equality_lookup(bencher: Bencher, size: usize) {
124+
let array = make_struct_array(size);
125+
126+
// Map specific values: CASE WHEN value = 0 THEN 'a' WHEN value = 1 THEN 'b' ... ELSE 'other' END
127+
let pairs: Vec<_> = (0..5)
128+
.map(|i| (eq(get_item("value", root()), lit(i)), lit(i * 10)))
129+
.collect();
130+
let expr = nested_case_when(pairs, Some(lit(-1i32)));
131+
132+
bencher
133+
.with_inputs(|| (&expr, &array))
134+
.bench_refs(|(expr, array)| {
135+
let mut ctx = SESSION.create_execution_ctx();
136+
array
137+
.apply(expr)
138+
.unwrap()
139+
.execute::<Canonical>(&mut ctx)
140+
.unwrap()
141+
});
142+
}
143+
144+
/// Benchmark CASE WHEN without ELSE clause (result is nullable).
145+
#[divan::bench(args = [1000, 10000, 100000])]
146+
fn case_when_without_else(bencher: Bencher, size: usize) {
147+
let array = make_struct_array(size);
148+
149+
// CASE WHEN value > 500 THEN 100 END
150+
let expr = case_when_no_else(gt(get_item("value", root()), lit(500i32)), lit(100i32));
151+
152+
bencher
153+
.with_inputs(|| (&expr, &array))
154+
.bench_refs(|(expr, array)| {
155+
let mut ctx = SESSION.create_execution_ctx();
156+
array
157+
.apply(expr)
158+
.unwrap()
159+
.execute::<Canonical>(&mut ctx)
160+
.unwrap()
161+
});
162+
}
163+
164+
/// Benchmark CASE WHEN where all conditions are true.
165+
#[divan::bench(args = [1000, 10000, 100000])]
166+
fn case_when_all_true(bencher: Bencher, size: usize) {
167+
let array = make_struct_array(size);
168+
169+
// CASE WHEN value >= 0 THEN 100 ELSE 0 END (always true for our data)
170+
let expr = case_when(
171+
gt(get_item("value", root()), lit(-1i32)),
172+
lit(100i32),
173+
lit(0i32),
174+
);
175+
176+
bencher
177+
.with_inputs(|| (&expr, &array))
178+
.bench_refs(|(expr, array)| {
179+
let mut ctx = SESSION.create_execution_ctx();
180+
array
181+
.apply(expr)
182+
.unwrap()
183+
.execute::<Canonical>(&mut ctx)
184+
.unwrap()
185+
});
186+
}
187+
188+
/// Benchmark CASE WHEN where all conditions are false.
189+
#[divan::bench(args = [1000, 10000, 100000])]
190+
fn case_when_all_false(bencher: Bencher, size: usize) {
191+
let array = make_struct_array(size);
192+
193+
// CASE WHEN value > 1000000 THEN 100 ELSE 0 END (always false for our data)
194+
let expr = case_when(
195+
gt(get_item("value", root()), lit(1_000_000i32)),
196+
lit(100i32),
197+
lit(0i32),
198+
);
199+
200+
bencher
201+
.with_inputs(|| (&expr, &array))
202+
.bench_refs(|(expr, array)| {
203+
let mut ctx = SESSION.create_execution_ctx();
204+
array
205+
.apply(expr)
206+
.unwrap()
207+
.execute::<Canonical>(&mut ctx)
208+
.unwrap()
209+
});
210+
}

vortex-array/public-api.lock

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10106,6 +10106,10 @@ pub fn vortex_array::expr::and_collect<I>(iter: I) -> core::option::Option<vorte
1010610106

1010710107
pub fn vortex_array::expr::between(arr: vortex_array::expr::Expression, lower: vortex_array::expr::Expression, upper: vortex_array::expr::Expression, options: vortex_array::scalar_fn::fns::between::BetweenOptions) -> vortex_array::expr::Expression
1010810108

10109+
pub fn vortex_array::expr::case_when(condition: vortex_array::expr::Expression, then_value: vortex_array::expr::Expression, else_value: vortex_array::expr::Expression) -> vortex_array::expr::Expression
10110+
10111+
pub fn vortex_array::expr::case_when_no_else(condition: vortex_array::expr::Expression, then_value: vortex_array::expr::Expression) -> vortex_array::expr::Expression
10112+
1010910113
pub fn vortex_array::expr::cast(child: vortex_array::expr::Expression, target: vortex_array::dtype::DType) -> vortex_array::expr::Expression
1011010114

1011110115
pub fn vortex_array::expr::checked_add(lhs: vortex_array::expr::Expression, rhs: vortex_array::expr::Expression) -> vortex_array::expr::Expression
@@ -10160,6 +10164,8 @@ pub fn vortex_array::expr::merge(elements: impl core::iter::traits::collect::Int
1016010164

1016110165
pub fn vortex_array::expr::merge_opts(elements: impl core::iter::traits::collect::IntoIterator<Item = impl core::convert::Into<vortex_array::expr::Expression>>, duplicate_handling: vortex_array::scalar_fn::fns::merge::DuplicateHandling) -> vortex_array::expr::Expression
1016210166

10167+
pub fn vortex_array::expr::nested_case_when(when_then_pairs: alloc::vec::Vec<(vortex_array::expr::Expression, vortex_array::expr::Expression)>, else_value: core::option::Option<vortex_array::expr::Expression>) -> vortex_array::expr::Expression
10168+
1016310169
pub fn vortex_array::expr::not(operand: vortex_array::expr::Expression) -> vortex_array::expr::Expression
1016410170

1016510171
pub fn vortex_array::expr::not_eq(lhs: vortex_array::expr::Expression, rhs: vortex_array::expr::Expression) -> vortex_array::expr::Expression
@@ -13210,6 +13216,86 @@ pub fn vortex_array::scalar_fn::fns::binary::or_kleene(lhs: &vortex_array::Array
1321013216

1321113217
pub fn vortex_array::scalar_fn::fns::binary::scalar_cmp(lhs: &vortex_array::scalar::Scalar, rhs: &vortex_array::scalar::Scalar, operator: vortex_array::scalar_fn::fns::operators::CompareOperator) -> vortex_array::scalar::Scalar
1321213218

13219+
pub mod vortex_array::scalar_fn::fns::case_when
13220+
13221+
pub struct vortex_array::scalar_fn::fns::case_when::CaseWhen
13222+
13223+
impl core::clone::Clone for vortex_array::scalar_fn::fns::case_when::CaseWhen
13224+
13225+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::clone(&self) -> vortex_array::scalar_fn::fns::case_when::CaseWhen
13226+
13227+
impl vortex_array::scalar_fn::ScalarFnVTable for vortex_array::scalar_fn::fns::case_when::CaseWhen
13228+
13229+
pub type vortex_array::scalar_fn::fns::case_when::CaseWhen::Options = vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13230+
13231+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::arity(&self, options: &Self::Options) -> vortex_array::scalar_fn::Arity
13232+
13233+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::child_name(&self, options: &Self::Options, child_idx: usize) -> vortex_array::scalar_fn::ChildName
13234+
13235+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::deserialize(&self, metadata: &[u8], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Options>
13236+
13237+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::execute(&self, options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::ArrayRef>
13238+
13239+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
13240+
13241+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::id(&self) -> vortex_array::scalar_fn::ScalarFnId
13242+
13243+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::is_fallible(&self, _options: &Self::Options) -> bool
13244+
13245+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::is_null_sensitive(&self, _options: &Self::Options) -> bool
13246+
13247+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::reduce(&self, options: &Self::Options, node: &dyn vortex_array::scalar_fn::ReduceNode, ctx: &dyn vortex_array::scalar_fn::ReduceCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::scalar_fn::ReduceNodeRef>>
13248+
13249+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::return_dtype(&self, options: &Self::Options, arg_dtypes: &[vortex_array::dtype::DType]) -> vortex_error::VortexResult<vortex_array::dtype::DType>
13250+
13251+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::serialize(&self, options: &Self::Options) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
13252+
13253+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::simplify(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, ctx: &dyn vortex_array::scalar_fn::SimplifyCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
13254+
13255+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::simplify_untyped(&self, options: &Self::Options, expr: &vortex_array::expr::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
13256+
13257+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::stat_expression(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, stat: vortex_array::expr::stats::Stat, catalog: &dyn vortex_array::expr::pruning::StatsCatalog) -> core::option::Option<vortex_array::expr::Expression>
13258+
13259+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::stat_falsification(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, catalog: &dyn vortex_array::expr::pruning::StatsCatalog) -> core::option::Option<vortex_array::expr::Expression>
13260+
13261+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::validity(&self, options: &Self::Options, expression: &vortex_array::expr::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
13262+
13263+
pub struct vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13264+
13265+
pub vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::has_else: bool
13266+
13267+
pub vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::num_when_then_pairs: u32
13268+
13269+
impl vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13270+
13271+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::num_children(&self) -> usize
13272+
13273+
impl core::clone::Clone for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13274+
13275+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::clone(&self) -> vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13276+
13277+
impl core::cmp::Eq for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13278+
13279+
impl core::cmp::PartialEq for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13280+
13281+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::eq(&self, other: &vortex_array::scalar_fn::fns::case_when::CaseWhenOptions) -> bool
13282+
13283+
impl core::fmt::Debug for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13284+
13285+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
13286+
13287+
impl core::fmt::Display for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13288+
13289+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
13290+
13291+
impl core::hash::Hash for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13292+
13293+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhenOptions::hash<__H: core::hash::Hasher>(&self, state: &mut __H)
13294+
13295+
impl core::marker::Copy for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13296+
13297+
impl core::marker::StructuralPartialEq for vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
13298+
1321313299
pub mod vortex_array::scalar_fn::fns::cast
1321413300

1321513301
pub struct vortex_array::scalar_fn::fns::cast::Cast
@@ -15042,6 +15128,42 @@ pub fn vortex_array::scalar_fn::fns::binary::Binary::stat_falsification(&self, o
1504215128

1504315129
pub fn vortex_array::scalar_fn::fns::binary::Binary::validity(&self, operator: &vortex_array::scalar_fn::fns::operators::Operator, expression: &vortex_array::expr::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
1504415130

15131+
impl vortex_array::scalar_fn::ScalarFnVTable for vortex_array::scalar_fn::fns::case_when::CaseWhen
15132+
15133+
pub type vortex_array::scalar_fn::fns::case_when::CaseWhen::Options = vortex_array::scalar_fn::fns::case_when::CaseWhenOptions
15134+
15135+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::arity(&self, options: &Self::Options) -> vortex_array::scalar_fn::Arity
15136+
15137+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::child_name(&self, options: &Self::Options, child_idx: usize) -> vortex_array::scalar_fn::ChildName
15138+
15139+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::deserialize(&self, metadata: &[u8], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Options>
15140+
15141+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::execute(&self, options: &Self::Options, args: &dyn vortex_array::scalar_fn::ExecutionArgs, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::ArrayRef>
15142+
15143+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::fmt_sql(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
15144+
15145+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::id(&self) -> vortex_array::scalar_fn::ScalarFnId
15146+
15147+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::is_fallible(&self, _options: &Self::Options) -> bool
15148+
15149+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::is_null_sensitive(&self, _options: &Self::Options) -> bool
15150+
15151+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::reduce(&self, options: &Self::Options, node: &dyn vortex_array::scalar_fn::ReduceNode, ctx: &dyn vortex_array::scalar_fn::ReduceCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::scalar_fn::ReduceNodeRef>>
15152+
15153+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::return_dtype(&self, options: &Self::Options, arg_dtypes: &[vortex_array::dtype::DType]) -> vortex_error::VortexResult<vortex_array::dtype::DType>
15154+
15155+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::serialize(&self, options: &Self::Options) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
15156+
15157+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::simplify(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, ctx: &dyn vortex_array::scalar_fn::SimplifyCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
15158+
15159+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::simplify_untyped(&self, options: &Self::Options, expr: &vortex_array::expr::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
15160+
15161+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::stat_expression(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, stat: vortex_array::expr::stats::Stat, catalog: &dyn vortex_array::expr::pruning::StatsCatalog) -> core::option::Option<vortex_array::expr::Expression>
15162+
15163+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::stat_falsification(&self, options: &Self::Options, expr: &vortex_array::expr::Expression, catalog: &dyn vortex_array::expr::pruning::StatsCatalog) -> core::option::Option<vortex_array::expr::Expression>
15164+
15165+
pub fn vortex_array::scalar_fn::fns::case_when::CaseWhen::validity(&self, options: &Self::Options, expression: &vortex_array::expr::Expression) -> vortex_error::VortexResult<core::option::Option<vortex_array::expr::Expression>>
15166+
1504515167
impl vortex_array::scalar_fn::ScalarFnVTable for vortex_array::scalar_fn::fns::cast::Cast
1504615168

1504715169
pub type vortex_array::scalar_fn::fns::cast::Cast::Options = vortex_array::dtype::DType

0 commit comments

Comments
 (0)