Skip to content

Commit

Permalink
Revert "Wip"
Browse files Browse the repository at this point in the history
This reverts commit 3846bfc.
  • Loading branch information
Dandandan committed Oct 24, 2024
1 parent 3846bfc commit b6a59fc
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions arrow-select/src/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,23 +473,15 @@ fn take_bytes<T: ByteArrayType, IndexType: ArrowPrimitiveType>(
}));
nulls = None
} else if indices.null_count() == 0 {
let nulls_buf = take_bits(array.nulls().unwrap().inner(), indices);

offsets.extend(
indices
.values()
.iter()
.zip(nulls_buf.iter())
.map(|(index, valid)| {
let index = index.as_usize();
if valid {
let s: &[u8] = array.value(index).as_ref();
values.extend_from_slice(s.as_ref());
}
T::Offset::usize_as(values.len())
}),
);
nulls = Some(nulls_buf.into_inner());
offsets.extend(indices.values().iter().map(|index| {
let index = index.as_usize();
if array.is_valid(index) {
let s: &[u8] = array.value(index).as_ref();
values.extend_from_slice(s.as_ref());
}
T::Offset::usize_as(values.len())
}));
nulls = Some(take_bits(array.nulls().unwrap().inner(), indices).into_inner());
} else if array.null_count() == 0 {
offsets.extend(indices.values().iter().enumerate().map(|(i, index)| {
if indices.is_valid(i) {
Expand Down

0 comments on commit b6a59fc

Please sign in to comment.