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
25 changes: 9 additions & 16 deletions vortex-btrblocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use std::fmt::Debug;
use std::hash::Hash;

use vortex_array::arrays::{
ExtensionArray, FixedSizeListArray, ListViewArray, StructArray, TemporalArray,
ExtensionArray, FixedSizeListArray, ListArray, StructArray, TemporalArray, list_from_list_view,
};
use vortex_array::vtable::{VTable, ValidityHelper};
use vortex_array::{Array, ArrayRef, Canonical, IntoArray, ToCanonical};
Expand Down Expand Up @@ -398,33 +398,26 @@ impl BtrBlocksCompressor {
)?
.into_array())
}
Canonical::List(list_array) => {
// Compress the inner elements.
Canonical::List(list_view_array) => {
// TODO(joe): We might want to write list views in the future and chose between
// list and list view.
let list_array = list_from_list_view(list_view_array);

let compressed_elems = self.compress(list_array.elements())?;

// Note that since the type of our offsets and sizes is not encoded in our `DType`,
// we can narrow the widths.
// Note that since the type of our offsets are not encoded in our `DType`,
// we may narrow the widths.

// Compress the offsets.
let compressed_offsets = IntCompressor::compress_no_dict(
&list_array.offsets().to_primitive().narrow()?,
false,
MAX_CASCADE,
&[],
)?;

// Compress the sizes.
let compressed_sizes = IntCompressor::compress_no_dict(
&list_array.sizes().to_primitive().narrow()?,
false,
MAX_CASCADE,
&[],
)?;

Ok(ListViewArray::try_new(
Ok(ListArray::try_new(
compressed_elems,
compressed_offsets,
compressed_sizes,
list_array.validity().clone(),
)?
.into_array())
Expand Down
Loading