Skip to content
Closed
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
4 changes: 2 additions & 2 deletions encodings/alp/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ pub const vortex_alp::ALPSlots::PATCH_INDICES: usize

pub const vortex_alp::ALPSlots::PATCH_VALUES: usize

pub fn vortex_alp::ALPSlots::from_slots(alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>) -> Self
pub fn vortex_alp::ALPSlots::from_slots(alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>) -> Self

pub fn vortex_alp::ALPSlots::into_slots(self) -> alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>
pub fn vortex_alp::ALPSlots::into_slots(self) -> alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>

pub struct vortex_alp::ALPSlotsView<'a>

Expand Down
6 changes: 3 additions & 3 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl ALP {
}

impl ALPData {
fn make_slots(encoded: &ArrayRef, patches: Option<&Patches>) -> Vec<Option<ArrayRef>> {
fn make_slots(encoded: &ArrayRef, patches: Option<&Patches>) -> Box<[Option<ArrayRef>]> {
let (patch_indices, patch_values, patch_chunk_offsets) = match patches {
Some(p) => (
Some(p.indices().clone()),
Expand All @@ -419,12 +419,12 @@ impl ALPData {
),
None => (None, None, None),
};
vec![
Box::new([
Some(encoded.clone()),
patch_indices,
patch_values,
patch_chunk_offsets,
]
])
}

#[inline]
Expand Down
6 changes: 3 additions & 3 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl ALPRDData {
left_parts: &ArrayRef,
right_parts: &ArrayRef,
patches: Option<&Patches>,
) -> Vec<Option<ArrayRef>> {
) -> Box<[Option<ArrayRef>]> {
let (pi, pv, pco) = match patches {
Some(p) => (
Some(p.indices().clone()),
Expand All @@ -474,13 +474,13 @@ impl ALPRDData {
),
None => (None, None, None),
};
vec![
Box::new([
Some(left_parts.clone()),
Some(right_parts.clone()),
pi,
pv,
pco,
]
])
}

/// Return all the owned parts of the array
Expand Down
4 changes: 2 additions & 2 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ impl ByteBoolData {
Ok(())
}

fn make_slots(validity: &Validity, len: usize) -> Vec<Option<ArrayRef>> {
vec![validity_to_child(validity, len)]
fn make_slots(validity: &Validity, len: usize) -> Box<[Option<ArrayRef>]> {
Box::new([validity_to_child(validity, len)])
}

pub fn new(buffer: BufferHandle) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions encodings/datetime-parts/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ pub const vortex_datetime_parts::DateTimePartsSlots::SECONDS: usize

pub const vortex_datetime_parts::DateTimePartsSlots::SUBSECONDS: usize

pub fn vortex_datetime_parts::DateTimePartsSlots::from_slots(alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>) -> Self
pub fn vortex_datetime_parts::DateTimePartsSlots::from_slots(alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>) -> Self

pub fn vortex_datetime_parts::DateTimePartsSlots::into_slots(self) -> alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>
pub fn vortex_datetime_parts::DateTimePartsSlots::into_slots(self) -> alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>

pub struct vortex_datetime_parts::DateTimePartsSlotsView<'a>

Expand Down
4 changes: 2 additions & 2 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl VTable for DateTimeParts {
len,
)?;

let slots = vec![Some(days), Some(seconds), Some(subseconds)];
let slots = Box::new([Some(days), Some(seconds), Some(subseconds)]);
let data = DateTimePartsData {};
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -275,7 +275,7 @@ impl DateTimeParts {
) -> VortexResult<DateTimePartsArray> {
let len = days.len();
DateTimePartsData::validate(&dtype, &days, &seconds, &subseconds, len)?;
let slots = vec![Some(days), Some(seconds), Some(subseconds)];
let slots = Box::new([Some(days), Some(seconds), Some(subseconds)]);
let data = DateTimePartsData {};
Ok(unsafe {
Array::from_parts_unchecked(
Expand Down
4 changes: 2 additions & 2 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl VTable for DecimalByteParts {
"lower_part_count > 0 not currently supported"
);

let slots = vec![Some(msp.clone())];
let slots = Box::new([Some(msp.clone())]);
let data = DecimalBytePartsData::try_new(msp.dtype(), msp.len(), *decimal_dtype)?;
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -262,7 +262,7 @@ impl DecimalByteParts {
) -> VortexResult<DecimalBytePartsArray> {
let len = msp.len();
let dtype = DType::Decimal(decimal_dtype, msp.dtype().nullability());
let slots = vec![Some(msp.clone())];
let slots = Box::new([Some(msp.clone())]);
let data = DecimalBytePartsData::try_new(msp.dtype(), msp.len(), decimal_dtype)?;
Ok(unsafe {
Array::from_parts_unchecked(
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ pub const vortex_fastlanes::BitPackedSlots::PATCH_VALUES: usize

pub const vortex_fastlanes::BitPackedSlots::VALIDITY_CHILD: usize

pub fn vortex_fastlanes::BitPackedSlots::from_slots(alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>) -> Self
pub fn vortex_fastlanes::BitPackedSlots::from_slots(alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>) -> Self

pub fn vortex_fastlanes::BitPackedSlots::into_slots(self) -> alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>
pub fn vortex_fastlanes::BitPackedSlots::into_slots(self) -> alloc::boxed::Box<[core::option::Option<vortex_array::array::erased::ArrayRef>]>

pub struct vortex_fastlanes::Delta

Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/bitpacking/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl VTable for BitPacked {
None => (None, None, None),
};
let validity_slot = validity_to_child(&validity, len);
vec![pi, pv, pco, validity_slot]
Box::new([pi, pv, pco, validity_slot])
};
let data = BitPackedData::try_new(
packed,
Expand Down Expand Up @@ -331,7 +331,7 @@ impl BitPacked {
None => (None, None, None),
};
let validity_slot = validity_to_child(&validity, len);
vec![pi, pv, pco, validity_slot]
Box::new([pi, pv, pco, validity_slot])
};
let data = BitPackedData::try_new(packed, patches, bit_width, offset)?;
Array::try_from_parts(ArrayParts::new(BitPacked, dtype, len, data).with_slots(slots))
Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/delta/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl VTable for Delta {
let deltas = children.get(1, dtype, deltas_len)?;

let data = DeltaData::try_new(metadata.offset as usize)?;
let slots = vec![Some(bases), Some(deltas)];
let slots = Box::new([Some(bases), Some(deltas)]);
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}

Expand All @@ -191,7 +191,7 @@ impl Delta {
) -> VortexResult<DeltaArray> {
let dtype = bases.dtype().with_nullability(deltas.dtype().nullability());
let data = DeltaData::try_new(offset)?;
let slots = vec![Some(bases), Some(deltas)];
let slots = Box::new([Some(bases), Some(deltas)]);
Array::try_from_parts(ArrayParts::new(Delta, dtype, len, data).with_slots(slots))
}

Expand Down
4 changes: 2 additions & 2 deletions encodings/fastlanes/src/for/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl VTable for FoR {
let scalar_value = ScalarValue::from_proto_bytes(metadata, dtype, session)?;
let reference = Scalar::try_new(dtype.clone(), scalar_value)?;
let encoded = children.get(0, dtype, len)?;
let slots = vec![Some(encoded)];
let slots = Box::new([Some(encoded)]);

let data = FoRData::try_new(reference)?;
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
Expand Down Expand Up @@ -173,7 +173,7 @@ impl FoR {
let reference = reference.cast(&dtype)?;
let len = encoded.len();
let data = FoRData::try_new(reference)?;
let slots = vec![Some(encoded)];
let slots = Box::new([Some(encoded)]);
Array::try_from_parts(ArrayParts::new(FoR, dtype, len, data).with_slots(slots))
}

Expand Down
6 changes: 3 additions & 3 deletions encodings/fastlanes/src/rle/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl VTable for RLE {
usize::try_from(metadata.values_idx_offsets_len)?,
)?;

let slots = vec![Some(values), Some(indices), Some(values_idx_offsets)];
let slots = Box::new([Some(values), Some(indices), Some(values_idx_offsets)]);
let data = RLEData::try_new(metadata.offset as usize)?;
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -219,7 +219,7 @@ impl RLE {
length: usize,
) -> VortexResult<RLEArray> {
let dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability());
let slots = vec![Some(values), Some(indices), Some(values_idx_offsets)];
let slots = Box::new([Some(values), Some(indices), Some(values_idx_offsets)]);
let data = RLEData::try_new(offset)?;
Array::try_from_parts(ArrayParts::new(RLE, dtype, length, data).with_slots(slots))
}
Expand All @@ -236,7 +236,7 @@ impl RLE {
length: usize,
) -> RLEArray {
let dtype = DType::Primitive(values.dtype().as_ptype(), indices.dtype().nullability());
let slots = vec![Some(values), Some(indices), Some(values_idx_offsets)];
let slots = Box::new([Some(values), Some(indices), Some(values_idx_offsets)]);
let data = unsafe { RLEData::new_unchecked(offset) };
unsafe {
Array::from_parts_unchecked(ArrayParts::new(RLE, dtype, length, data).with_slots(slots))
Expand Down
10 changes: 5 additions & 5 deletions encodings/fsst/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ impl VTable for FSST {
len,
&mut ctx,
)?;
let slots = vec![
let slots = Box::new([
Some(uncompressed_lengths),
Some(codes_offsets),
validity_to_child(&codes_validity, len),
];
]);
let data = FSSTData::try_new(symbols, symbol_lengths, codes_bytes, len)?;
return Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots));
}
Expand Down Expand Up @@ -479,8 +479,8 @@ impl FSST {
}

impl FSSTData {
fn make_slots(codes: &VarBinArray, uncompressed_lengths: &ArrayRef) -> Vec<Option<ArrayRef>> {
vec![
fn make_slots(codes: &VarBinArray, uncompressed_lengths: &ArrayRef) -> Box<[Option<ArrayRef>]> {
Box::new([
Some(uncompressed_lengths.clone()),
Some(codes.offsets().clone()),
validity_to_child(
Expand All @@ -489,7 +489,7 @@ impl FSSTData {
.vortex_expect("FSST codes validity should be derivable"),
codes.len(),
),
]
])
}

/// Build FSST data from a set of `symbols`, `symbol_lengths`, and compressed codes bytes.
Expand Down
4 changes: 2 additions & 2 deletions encodings/parquet-variant/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ impl ParquetVariant {
&dtype,
len,
)?;
let slots = vec![
let slots = Box::new([
validity_to_child(&validity, len),
Some(metadata),
value,
typed_value,
];
]);
let data = ParquetVariantData;
Array::try_from_parts(ArrayParts::new(ParquetVariant, dtype, len, data).with_slots(slots))
}
Expand Down
4 changes: 2 additions & 2 deletions encodings/parquet-variant/src/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ impl VTable for ParquetVariant {
dtype,
len,
)?;
let slots = vec![
let slots = Box::new([
validity_to_child(&validity, len),
Some(variant_metadata),
value,
typed_value,
];
]);
let data = ParquetVariantData;
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down
4 changes: 2 additions & 2 deletions encodings/pco/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl VTable for Pco {
.sum::<usize>();
vortex_ensure!(pages.len() == expected_n_pages);

let slots = vec![validity_to_child(&validity, len)];
let slots = Box::new([validity_to_child(&validity, len)]);
let data = PcoData::new(chunk_metas, pages, dtype.as_ptype(), metadata, len);
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -291,7 +291,7 @@ impl Pco {
) -> VortexResult<PcoArray> {
let len = data.len();
data.validate(&dtype, len, &validity)?;
let slots = vec![validity_to_child(&validity, data.unsliced_n_rows())];
let slots = Box::new([validity_to_child(&validity, data.unsliced_n_rows())]);
Ok(unsafe {
Array::from_parts_unchecked(ArrayParts::new(Pco, dtype, len, data).with_slots(slots))
})
Expand Down
10 changes: 5 additions & 5 deletions encodings/runend/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl VTable for RunEnd {

let values = children.get(1, dtype, runs)?;
let offset = usize::try_from(metadata.offset).vortex_expect("Offset must be a valid usize");
let slots = vec![Some(ends), Some(values)];
let slots = Box::new([Some(ends), Some(values)]);
let data = RunEndData::new(offset);
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -258,7 +258,7 @@ impl RunEnd {
length: usize,
) -> RunEndArray {
let dtype = values.dtype().clone();
let slots = vec![Some(ends), Some(values)];
let slots = Box::new([Some(ends), Some(values)]);
let data = unsafe { RunEndData::new_unchecked(offset) };
unsafe {
Array::from_parts_unchecked(
Expand All @@ -276,7 +276,7 @@ impl RunEnd {
let len = RunEndData::logical_len_from_ends(&ends, ctx)?;
RunEndData::validate_parts(&ends, &values, 0, len, ctx)?;
let dtype = values.dtype().clone();
let slots = vec![Some(ends), Some(values)];
let slots = Box::new([Some(ends), Some(values)]);
let data = RunEndData::new(0);
Array::try_from_parts(ArrayParts::new(RunEnd, dtype, len, data).with_slots(slots))
}
Expand All @@ -291,7 +291,7 @@ impl RunEnd {
) -> VortexResult<RunEndArray> {
RunEndData::validate_parts(&ends, &values, offset, length, ctx)?;
let dtype = values.dtype().clone();
let slots = vec![Some(ends), Some(values)];
let slots = Box::new([Some(ends), Some(values)]);
let data = RunEndData::new(offset);
Array::try_from_parts(ArrayParts::new(RunEnd, dtype, length, data).with_slots(slots))
}
Expand All @@ -308,7 +308,7 @@ impl RunEnd {
let ends = ends.into_array();
let len = array.len();
let dtype = values.dtype().clone();
let slots = vec![Some(ends), Some(values)];
let slots = Box::new([Some(ends), Some(values)]);
let data = unsafe { RunEndData::new_unchecked(0) };
Array::try_from_parts(ArrayParts::new(RunEnd, dtype, len, data).with_slots(slots))
} else {
Expand Down
6 changes: 3 additions & 3 deletions encodings/sparse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,12 @@ impl SparseData {
Ok(())
}

fn make_slots(patches: &Patches) -> Vec<Option<ArrayRef>> {
vec![
fn make_slots(patches: &Patches) -> Box<[Option<ArrayRef>]> {
Box::new([
Some(patches.indices().clone()),
Some(patches.values().clone()),
patches.chunk_offsets().clone(),
]
])
}

/// Build a new SparseArray from an existing set of patches.
Expand Down
4 changes: 2 additions & 2 deletions encodings/zigzag/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl VTable for ZigZag {
let encoded_type = DType::Primitive(ptype.to_unsigned(), dtype.nullability());

let encoded = children.get(0, &encoded_type, len)?;
let slots = vec![Some(encoded.clone())];
let slots = Box::new([Some(encoded.clone())]);
let data = ZigZagData::try_new(encoded.dtype())?;
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -201,7 +201,7 @@ impl ZigZag {
pub fn try_new(encoded: ArrayRef) -> VortexResult<ZigZagArray> {
let dtype = ZigZagData::dtype_from_encoded_dtype(encoded.dtype())?;
let len = encoded.len();
let slots = vec![Some(encoded.clone())];
let slots = Box::new([Some(encoded.clone())]);
let data = ZigZagData::try_new(encoded.dtype())?;
Ok(unsafe {
Array::from_parts_unchecked(ArrayParts::new(ZigZag, dtype, len, data).with_slots(slots))
Expand Down
4 changes: 2 additions & 2 deletions encodings/zstd/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl VTable for Zstd {
)
};

let slots = vec![validity_to_child(&validity, len)];
let slots = Box::new([validity_to_child(&validity, len)]);
let data = ZstdData::new(dictionary_buffer, compressed_buffers, metadata, len);
Ok(ArrayParts::new(self.clone(), dtype.clone(), len, data).with_slots(slots))
}
Expand Down Expand Up @@ -257,7 +257,7 @@ impl Zstd {
pub fn try_new(dtype: DType, data: ZstdData, validity: Validity) -> VortexResult<ZstdArray> {
let len = data.len();
data.validate(&dtype, len, &validity)?;
let slots = vec![validity_to_child(&validity, data.unsliced_n_rows())];
let slots = Box::new([validity_to_child(&validity, data.unsliced_n_rows())]);
Ok(unsafe {
Array::from_parts_unchecked(ArrayParts::new(Zstd, dtype, len, data).with_slots(slots))
})
Expand Down
Loading
Loading