Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions vortex-array/src/arrays/list/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::array::child_to_validity;
use crate::array::validity_to_child;
use crate::arrays::ConstantArray;
use crate::arrays::List;
use crate::arrays::ListArray;
use crate::arrays::Primitive;
use crate::builtins::ArrayBuiltins;
use crate::dtype::DType;
Expand Down Expand Up @@ -338,7 +339,6 @@ pub trait ListArrayExt: TypedArrayRef<List> {
let mut elements = self.sliced_elements()?;
if recurse && elements.is_canonical() {
let compacted = elements
.clone()
.execute::<Canonical>(ctx)?
Comment thread
robert3005 marked this conversation as resolved.
.compact(ctx)?
.into_array();
Expand All @@ -357,7 +357,8 @@ pub trait ListArrayExt: TypedArrayRef<List> {
Operator::Sub,
)?;

Array::<List>::try_new(elements, adjusted_offsets, self.list_validity())
// SAFETY: By resetting the offsets we simply "shift" everything left and discard trailing garbage, so all invariants remain the same.
Ok(unsafe { ListArray::new_unchecked(elements, adjusted_offsets, self.list_validity()) })
Comment thread
robert3005 marked this conversation as resolved.
}
}
impl<T: TypedArrayRef<List>> ListArrayExt for T {}
Expand Down
Loading