Skip to content

Commit ca773ed

Browse files
committed
Add remaining scalar function validity hooks
Signed-off-by: Nicholas Gates <nick@nickgates.com>
1 parent aaf35d4 commit ca773ed

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

vortex-geo/src/scalar_fn/distance.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use vortex_array::arrays::ScalarFnArray;
1313
use vortex_array::dtype::DType;
1414
use vortex_array::dtype::Nullability;
1515
use vortex_array::dtype::PType;
16+
use vortex_array::expr::Expression;
17+
use vortex_array::expr::lit;
1618
use vortex_array::scalar::Scalar;
1719
use vortex_array::scalar_fn::Arity;
1820
use vortex_array::scalar_fn::ChildName;
@@ -125,6 +127,14 @@ impl ScalarFnVTable for GeoDistance {
125127
}
126128
}
127129
}
130+
131+
fn validity(
132+
&self,
133+
_options: &Self::Options,
134+
_expression: &Expression,
135+
) -> VortexResult<Expression> {
136+
Ok(lit(true))
137+
}
128138
}
129139

130140
/// Distance from each row of `points` to a constant `query` point, decoded once and broadcast.

vortex-row/src/encode.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use vortex_array::arrays::PrimitiveArray;
1818
use vortex_array::dtype::DType;
1919
use vortex_array::dtype::Nullability;
2020
use vortex_array::dtype::PType;
21+
use vortex_array::expr::Expression;
22+
use vortex_array::expr::lit;
2123
use vortex_array::scalar_fn::Arity;
2224
use vortex_array::scalar_fn::ChildName;
2325
use vortex_array::scalar_fn::ExecutionArgs;
@@ -90,6 +92,14 @@ impl ScalarFnVTable for RowEncode {
9092
execute_row_encode(options, args, ctx)
9193
}
9294

95+
fn validity(
96+
&self,
97+
_options: &Self::Options,
98+
_expression: &Expression,
99+
) -> VortexResult<Expression> {
100+
Ok(lit(true))
101+
}
102+
93103
fn is_null_sensitive(&self, _options: &Self::Options) -> bool {
94104
true
95105
}

vortex-row/src/size.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use vortex_array::dtype::FieldNames;
1818
use vortex_array::dtype::Nullability;
1919
use vortex_array::dtype::PType;
2020
use vortex_array::dtype::StructFields;
21+
use vortex_array::expr::Expression;
22+
use vortex_array::expr::lit;
2123
use vortex_array::scalar::Scalar;
2224
use vortex_array::scalar_fn::Arity;
2325
use vortex_array::scalar_fn::ChildName;
@@ -242,6 +244,14 @@ impl ScalarFnVTable for RowSize {
242244
.into_array())
243245
}
244246

247+
fn validity(
248+
&self,
249+
_options: &Self::Options,
250+
_expression: &Expression,
251+
) -> VortexResult<Expression> {
252+
Ok(lit(true))
253+
}
254+
245255
fn is_null_sensitive(&self, _options: &Self::Options) -> bool {
246256
true
247257
}

0 commit comments

Comments
 (0)