Skip to content

Commit 01cb491

Browse files
committed
Avoid normalizing unused null list indices
Signed-off-by: Daniel King <dan@spiraldb.com>
1 parent 087a3eb commit 01cb491

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

  • vortex-array/src/arrays/list/compute

vortex-array/src/arrays/list/compute/take.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ use crate::arrays::list::ListArrayExt;
2424
use crate::arrays::piecewise_sequence::constant_unsigned_usize;
2525
use crate::arrays::piecewise_sequence::maybe_contiguous_slices;
2626
use crate::arrays::primitive::PrimitiveArrayExt;
27-
use crate::builtins::ArrayBuiltins;
2827
use crate::dtype::IntegerPType;
2928
use crate::dtype::UnsignedPType;
3029
use crate::executor::ExecutionCtx;
3130
use crate::match_each_unsigned_integer_ptype;
3231
use crate::match_smallest_offset_type;
33-
use crate::scalar::Scalar;
3432
use crate::validity::Validity;
3533

3634
// TODO(connor)[ListView]: Re-revert to the version where we simply convert to a `ListView` and call
@@ -55,11 +53,7 @@ impl TakeExecute for List {
5553
}
5654

5755
let new_validity = array.validity()?.take(indices)?;
58-
let normalized_indices = indices
59-
.clone()
60-
.mask(new_validity.to_array(indices.len()))?
61-
.fill_null(Scalar::from(0).cast(indices.dtype())?)?;
62-
let indices = normalized_indices.execute::<PrimitiveArray>(ctx)?;
56+
let indices = indices.clone().execute::<PrimitiveArray>(ctx)?;
6357
let indices = indices.reinterpret_cast(indices.ptype().to_unsigned());
6458
let offsets = array.offsets().clone().execute::<PrimitiveArray>(ctx)?;
6559
let offsets = offsets.reinterpret_cast(offsets.ptype().to_unsigned());

0 commit comments

Comments
 (0)