Skip to content

Commit 71ce663

Browse files
committed
update
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
1 parent 5d6bbdb commit 71ce663

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

vortex-array/src/scalar_fn/fns/binary/mod.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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

vortex-array/src/scalar_fn/fns/mask/kernel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.
5959
fn 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>() {

0 commit comments

Comments
 (0)