Skip to content

Commit e25c0a2

Browse files
authored
actually make ZCTL (#5402)
Signed-off-by: Andrew Duffy <[email protected]>
1 parent 63aa58c commit e25c0a2

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

vortex-array/src/arrays/listview/rebuild.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,17 @@ impl ListViewArray {
142142
let elements =
143143
unsafe { ChunkedArray::new_unchecked(chunks, element_dtype.as_ref().clone()) };
144144

145-
ListViewArray::new(
146-
elements.to_canonical().into_array(),
147-
offsets,
148-
sizes,
149-
self.validity.clone(),
150-
)
145+
// SAFETY: elements are contiguous, offsets and sizes hand-built to be zero copy
146+
// to list.
147+
unsafe {
148+
ListViewArray::new_unchecked(
149+
elements.to_canonical().into_array(),
150+
offsets,
151+
sizes,
152+
self.validity.clone(),
153+
)
154+
.with_zero_copy_to_list(true)
155+
}
151156
}
152157

153158
/// Rebuilds a [`ListViewArray`] by trimming any unused / unreferenced leading and trailing

0 commit comments

Comments
 (0)