Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion bench-vortex/src/bin/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use vortex::array::IntoArray;
use vortex::array::arrays::ChunkedArray;
use vortex::array::arrays::ChunkedVTable;
use vortex::array::builders::builder_with_capacity;
use vortex::error::VortexExpect;
use vortex::utils::aliases::hash_map::HashMap;

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -235,7 +236,9 @@ pub fn benchmark_compress(
.iter()
.map(|chunk| {
let mut builder = builder_with_capacity(chunk.dtype(), chunk.len());
chunk.append_to_builder(builder.as_mut());
chunk
.append_to_builder(builder.as_mut())
.vortex_expect("append_to_builder");
builder.finish()
}),
)
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/bin/random_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ fn random_access(
}

fn validate_vortex_array(array: ArrayRef) {
let struct_ = array.to_struct();
let struct_ = array.to_struct().vortex_expect("to_struct");
assert_eq!(struct_.len(), 6, "expected 6 rows");
let pu_location_id = struct_
.field_by_name("PULocationID")
Expand Down
4 changes: 2 additions & 2 deletions bench-vortex/src/datasets/tpch_l_comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Dataset for TPCHLCommentChunked {
let file_chunks: Vec<_> = file
.scan()?
.with_projection(pack(vec![("l_comment", col("l_comment"))], NonNullable))
.map(|a| Ok(a.to_canonical().into_array()))
.map(|a| Ok(a.to_canonical()?.into_array()))
.into_array_stream()?
.try_collect()
.await?;
Expand All @@ -78,7 +78,7 @@ impl Dataset for TPCHLCommentCanonical {
let comments_canonical = TPCHLCommentChunked
.to_vortex_array()
.await?
.to_struct()
.to_struct()?
.into_array();
Ok(ChunkedArray::from_iter([comments_canonical]).into_array())
}
Expand Down
2 changes: 1 addition & 1 deletion bench-vortex/src/random_access/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async fn take_vortex(reader: impl AsRef<Path>, indices: Buffer<u64>) -> anyhow::
.read_all()
.await?
// We canonicalize / decompress for equivalence to Arrow's `RecordBatch`es.
.to_canonical()
.to_canonical()?
.into_array())
}

Expand Down
18 changes: 9 additions & 9 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ impl BaseArrayVTable<ALPVTable> for ALPVTable {
}

impl CanonicalVTable<ALPVTable> for ALPVTable {
fn canonicalize(array: &ALPArray) -> Canonical {
Canonical::Primitive(decompress_into_array(array.clone()))
fn canonicalize(array: &ALPArray) -> VortexResult<Canonical> {
Ok(Canonical::Primitive(decompress_into_array(array.clone())?))
}
}

Expand Down Expand Up @@ -482,7 +482,7 @@ mod tests {

let result_vector = encoded.to_array().execute(&SESSION).unwrap();
// Compare against the traditional array-based decompress path
let expected = decompress_into_array(encoded);
let expected = decompress_into_array(encoded).unwrap();

assert_eq!(result_vector.len(), size);

Expand All @@ -506,7 +506,7 @@ mod tests {

let result_vector = encoded.to_array().execute(&SESSION).unwrap();
// Compare against the traditional array-based decompress path
let expected = decompress_into_array(encoded);
let expected = decompress_into_array(encoded).unwrap();

assert_eq!(result_vector.len(), size);

Expand Down Expand Up @@ -536,7 +536,7 @@ mod tests {

let result_vector = encoded.to_array().execute(&SESSION).unwrap();
// Compare against the traditional array-based decompress path
let expected = decompress_into_array(encoded);
let expected = decompress_into_array(encoded).unwrap();

assert_eq!(result_vector.len(), size);

Expand Down Expand Up @@ -564,7 +564,7 @@ mod tests {

let result_vector = encoded.to_array().execute(&SESSION).unwrap();
// Compare against the traditional array-based decompress path
let expected = decompress_into_array(encoded);
let expected = decompress_into_array(encoded).unwrap();

assert_eq!(result_vector.len(), size);

Expand All @@ -575,7 +575,7 @@ mod tests {
for idx in 0..size {
assert_eq!(
result_primitive.validity().value(idx),
expected.validity().is_valid(idx)
expected.validity().is_valid(idx).unwrap()
);
}
}
Expand Down Expand Up @@ -603,7 +603,7 @@ mod tests {

let result_vector = encoded.to_array().execute(&SESSION).unwrap();
// Compare against the traditional array-based decompress path
let expected = decompress_into_array(encoded);
let expected = decompress_into_array(encoded).unwrap();

assert_eq!(result_vector.len(), size);

Expand All @@ -614,7 +614,7 @@ mod tests {
for idx in 0..size {
assert_eq!(
result_primitive.validity().value(idx),
expected.validity().is_valid(idx)
expected.validity().is_valid(idx).unwrap()
);
}
}
Expand Down
Loading
Loading