Skip to content

Commit

Permalink
don't forget offset in byte in vec_hasher (#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Feb 13, 2022
1 parent 54eea34 commit 096095c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions polars/polars-core/src/vector_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ where
let mut offset = 0;
self.downcast_iter().for_each(|arr| {
if let Some(validity) = arr.validity() {
let slice = validity.as_slice().0;
let (slice, offset, _) = validity.as_slice();
(0..validity.len())
.map(|i| unsafe { get_bit_unchecked(slice, i) })
.map(|i| unsafe { get_bit_unchecked(slice, i + offset) })
.zip(&mut hashes[offset..])
.for_each(|(valid, h)| {
*h = [null_h, *h][valid as usize];
Expand Down Expand Up @@ -98,7 +98,7 @@ where
}),
_ => {
let validity = arr.validity().unwrap();
let slice = validity.as_slice().0;
let (slice, offset, _) = validity.as_slice();
(0..validity.len())
.map(|i| unsafe { get_bit_unchecked(slice, i) })
.zip(&mut hashes[offset..])
Expand Down

0 comments on commit 096095c

Please sign in to comment.