From b6a59fc9b2329ee7b10d81992244f22ea0fc2d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Heres?= Date: Thu, 24 Oct 2024 16:26:40 +0200 Subject: [PATCH] Revert "Wip" This reverts commit 3846bfcddfebf0361c0b947cc2dda71c56af4e8c. --- arrow-select/src/take.rs | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/arrow-select/src/take.rs b/arrow-select/src/take.rs index d08f3edf61fd..e2d99e86b170 100644 --- a/arrow-select/src/take.rs +++ b/arrow-select/src/take.rs @@ -473,23 +473,15 @@ fn take_bytes( })); 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) {