diff --git a/codecz/src/utils.rs b/codecz/src/utils.rs index 771b2d6c4a..30a4a0e87f 100644 --- a/codecz/src/utils.rs +++ b/codecz/src/utils.rs @@ -14,22 +14,24 @@ extern crate alloc; -use crate::{AlignedVec, ALIGNED_ALLOCATOR}; use alloc::sync::Arc; -use arrow_buffer::{BooleanBuffer, Buffer}; use core::ptr::NonNull; -pub fn into_u32_vec(bb: &BooleanBuffer, cardinality: usize) -> AlignedVec { - let mut vec: AlignedVec = AlignedVec::with_capacity_in(cardinality, ALIGNED_ALLOCATOR); +use arrow_buffer::{BooleanBuffer, Buffer}; + +use crate::{AlignedVec, ALIGNED_ALLOCATOR}; + +pub fn into_u64_vec(bb: &BooleanBuffer, cardinality: usize) -> AlignedVec { + let mut vec: AlignedVec = AlignedVec::with_capacity_in(cardinality, ALIGNED_ALLOCATOR); if cardinality > 0 { for idx in bb.set_indices() { - vec.push(idx as u32); + vec.push(idx as u64); } } vec } -pub fn gather_patches(data: &[T], indices: &[u32]) -> AlignedVec { +pub fn gather_patches(data: &[T], indices: &[u64]) -> AlignedVec { let mut vec: AlignedVec = AlignedVec::with_capacity_in(indices.len(), ALIGNED_ALLOCATOR); for idx in indices { vec.push(data[*idx as usize]); diff --git a/vortex-alp/src/compress.rs b/vortex-alp/src/compress.rs index d44a5a55d2..da428c719f 100644 --- a/vortex-alp/src/compress.rs +++ b/vortex-alp/src/compress.rs @@ -129,7 +129,7 @@ where let patches = if num_exceptions == 0 { None } else { - let patch_indices = codecz::utils::into_u32_vec(&exceptions_idx, num_exceptions); + let patch_indices = codecz::utils::into_u64_vec(&exceptions_idx, num_exceptions); let patch_values = codecz::utils::gather_patches( values.buffer().typed_data::(), patch_indices.as_slice(), diff --git a/vortex-ffor/src/compress.rs b/vortex-ffor/src/compress.rs index 3e1ed8d0c1..1ec08b2aed 100644 --- a/vortex-ffor/src/compress.rs +++ b/vortex-ffor/src/compress.rs @@ -14,7 +14,6 @@ use log::debug; -use crate::downcast::DowncastFFOR; use codecz::ffor; use codecz::ffor::{FforEncoded, SupportsFFoR}; use vortex::array::downcast::DowncastArrayBuiltin; @@ -27,6 +26,7 @@ use vortex::ptype::NativePType; use vortex::scalar::{ListScalarVec, NullableScalar, Scalar}; use vortex::stats::Stat; +use crate::downcast::DowncastFFOR; use crate::ffor::{FFORArray, FFoREncoding}; impl EncodingCompression for FFoREncoding { @@ -145,7 +145,7 @@ where } else { let (patch_values, patch_indices) = ffor::collect_exceptions(values, num_bits, min_val, num_exceptions).unwrap(); - let patch_indices = codecz::utils::into_u32_vec(&patch_indices, num_exceptions); + let patch_indices = codecz::utils::into_u64_vec(&patch_indices, num_exceptions); Some( SparseArray::new( PrimitiveArray::from_vec_in(patch_indices).boxed(),