Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions encodings/fsst/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use vortex_buffer::BufferHandle;
use vortex_dtype::DType;
use vortex_dtype::Nullability;
use vortex_dtype::PType;
use vortex_error::VortexExpect;
use vortex_error::VortexResult;
use vortex_error::vortex_bail;
use vortex_error::vortex_ensure;
Expand Down Expand Up @@ -157,7 +156,10 @@ impl VTable for FSSTVTable {
);

let mut children_iter = children.into_iter();
let codes = children_iter.next().vortex_expect("codes child");
let codes = children_iter
.next()
.ok_or_else(|| vortex_err!("FSSTArray with_children missing codes"))?;

let codes = codes
.as_opt::<VarBinVTable>()
.ok_or_else(|| {
Expand All @@ -169,7 +171,7 @@ impl VTable for FSSTVTable {
.clone();
let uncompressed_lengths = children_iter
.next()
.vortex_expect("uncompressed_lengths child");
.ok_or_else(|| vortex_err!("FSSTArray with_children missing uncompressed_lengths"))?;

array.codes = codes;
array.uncompressed_lengths = uncompressed_lengths;
Expand Down
6 changes: 5 additions & 1 deletion vortex-array/src/arrays/bool/vtable/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ impl ArrayParentReduceRule<Exact<BoolVTable>, Exact<MaskedVTable>> for BoolMaske
&self,
array: &BoolArray,
parent: &MaskedArray,
_child_idx: usize,
child_idx: usize,
) -> VortexResult<Option<ArrayRef>> {
if child_idx > 0 {
return Ok(None);
}

// Merge the parent's validity mask into the child's validity
// TODO(joe): make this lazy
Ok(Some(
Expand Down
14 changes: 12 additions & 2 deletions vortex-vector/src/listview/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,18 @@ impl VectorOps for ListViewVector {
ListViewScalar::new(self.slice(index..index + 1))
}

fn slice(&self, _range: impl RangeBounds<usize> + Clone + Debug) -> Self {
todo!()
fn slice(&self, range: impl RangeBounds<usize> + Clone + Debug) -> Self {
let offsets = self.offsets.slice(range.clone());
let sizes = self.sizes.slice(range);
// SAFETY: offsets/sizes combined still point at valid elements
unsafe {
Self::new_unchecked(
self.elements().clone(),
offsets,
sizes,
self.validity().clone(),
)
}
}

fn clear(&mut self) {
Expand Down
4 changes: 3 additions & 1 deletion vortex-vector/src/vector_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ impl VectorMut {
DType::Utf8(..) => StringVectorMut::with_capacity(capacity).into(),
DType::Binary(..) => BinaryVectorMut::with_capacity(capacity).into(),
DType::Extension(ext) => VectorMut::with_capacity(ext.storage_dtype(), capacity),
DType::List(..) => ListViewVectorMut::with_capacity(dtype, capacity).into(),
DType::List(elem, ..) => {
ListViewVectorMut::with_capacity(elem.as_ref(), capacity).into()
}
}
}
}
Expand Down
Loading