Skip to content

Commit

Permalink
Fix bitmask creation also for simd comparisons with scalar (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhorstmann authored Feb 9, 2022
1 parent 35e16be commit a049640
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion arrow/src/compute/kernels/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ where
let simd_result = simd_op(simd_left, simd_right);

let m = T::mask_to_u64(&simd_result);
bitmask |= m << (i / lanes);
bitmask |= m << i;

i += lanes;
}
Expand Down Expand Up @@ -2478,6 +2478,18 @@ mod tests {
let a = Int64Array::from($A_VEC);
let c = $KERNEL(&a, $B).unwrap();
assert_eq!(BooleanArray::from($EXPECTED), c);

// test with a larger version of the same data to ensure we cover the chunked part of the comparison
let mut a = vec![];
let mut e = vec![];
for _i in 0..10 {
a.extend($A_VEC);
e.extend($EXPECTED);
}
let a = Int64Array::from(a);
let c = $KERNEL(&a, $B).unwrap();
assert_eq!(BooleanArray::from(e), c);

};
}

Expand Down

0 comments on commit a049640

Please sign in to comment.