Skip to content

Commit ca9d9bb

Browse files
jhorstmannalamb
authored andcommitted
Fix bitmask creation also for simd comparisons with scalar (#1290)
1 parent e5003bf commit ca9d9bb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

arrow/src/compute/kernels/comparison.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ where
17991799
let simd_result = simd_op(simd_left, simd_right);
18001800

18011801
let m = T::mask_to_u64(&simd_result);
1802-
bitmask |= m << (i / lanes);
1802+
bitmask |= m << i;
18031803

18041804
i += lanes;
18051805
}
@@ -2478,6 +2478,18 @@ mod tests {
24782478
let a = Int64Array::from($A_VEC);
24792479
let c = $KERNEL(&a, $B).unwrap();
24802480
assert_eq!(BooleanArray::from($EXPECTED), c);
2481+
2482+
// test with a larger version of the same data to ensure we cover the chunked part of the comparison
2483+
let mut a = vec![];
2484+
let mut e = vec![];
2485+
for _i in 0..10 {
2486+
a.extend($A_VEC);
2487+
e.extend($EXPECTED);
2488+
}
2489+
let a = Int64Array::from(a);
2490+
let c = $KERNEL(&a, $B).unwrap();
2491+
assert_eq!(BooleanArray::from(e), c);
2492+
24812493
};
24822494
}
24832495

0 commit comments

Comments
 (0)