File tree Expand file tree Collapse file tree
vortex-array/src/scalar_fn/fns Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ impl ScalarFnVTable for Binary {
117117 let rhs = & arg_dtypes[ 1 ] ;
118118
119119 if operator. is_arithmetic ( ) {
120- if lhs. is_primitive ( ) && lhs. eq_ignore_nullability ( rhs) {
120+ if ( lhs. is_primitive ( ) || lhs . is_decimal ( ) ) && lhs. eq_ignore_nullability ( rhs) {
121121 return Ok ( lhs. with_nullability ( lhs. nullability ( ) | rhs. nullability ( ) ) ) ;
122122 }
123123 vortex_bail ! (
@@ -135,6 +135,16 @@ impl ScalarFnVTable for Binary {
135135 vortex_bail ! ( "Cannot compare different DTypes {} and {}" , lhs, rhs) ;
136136 }
137137
138+ if matches ! ( operator, Operator :: And | Operator :: Or )
139+ && ( !lhs. is_boolean ( ) || !rhs. is_boolean ( ) )
140+ {
141+ vortex_bail ! (
142+ "boolean operations require boolean inputs, got {} and {}" ,
143+ lhs,
144+ rhs
145+ ) ;
146+ }
147+
138148 Ok ( DType :: Bool ( ( lhs. is_nullable ( ) || rhs. is_nullable ( ) ) . into ( ) ) )
139149 }
140150
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ pub trait MaskKernel: VTable {
5757/// If the mask is a constant boolean, handle the trivial cases and return `Some`.
5858/// Returns `None` if the mask is not a constant.
5959fn handle_constant_mask (
60- array : & dyn crate :: array :: DynArray ,
60+ array : & dyn crate :: DynArray ,
6161 mask : & ArrayRef ,
6262) -> VortexResult < Option < ArrayRef > > {
6363 if let Some ( constant_mask) = mask. as_opt :: < Constant > ( ) {
You can’t perform that action at this time.
0 commit comments