Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ngates/arc-data
Browse files Browse the repository at this point in the history
  • Loading branch information
lwwmanning committed Dec 30, 2024
2 parents 76e5672 + a161e4c commit 6287db8
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 256 deletions.
156 changes: 9 additions & 147 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ categories = ["database-implementations", "data-structures", "compression"]

[workspace.dependencies]
anyhow = "1.0"
aligned-buffer = "0.2.0"
arbitrary = "1.3.2"
arrayref = "0.3.7"
arrow = { version = "53.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion encodings/fastlanes/src/bitpacking/compute/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ mod test {

#[test]
fn take_with_patches() {
let unpacked = Buffer::from_iter(0u32..100_000).into_array();
let unpacked = Buffer::from_iter(0u32..1024).into_array();
let bitpacked = BitPackedArray::encode(unpacked.as_ref(), 2).unwrap();

let indices = PrimitiveArray::from_iter([0, 2, 4, 6]);
Expand Down
8 changes: 2 additions & 6 deletions encodings/fsst/src/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use vortex_array::variants::PrimitiveArrayTrait;
use vortex_array::{
ArrayDType, ArrayData, Canonical, IntoArrayData, IntoArrayVariant, IntoCanonical,
};
use vortex_buffer::Buffer;
use vortex_buffer::{Buffer, ByteBuffer};
use vortex_dtype::match_each_integer_ptype;
use vortex_error::VortexResult;

Expand All @@ -28,8 +28,6 @@ impl IntoCanonical for FSSTArray {
.into_primitive()?;

// Bulk-decompress the entire array.
// TODO(ngates): return non-vec to avoid this copy
// See: https://github.com/spiraldb/fsst/issues/61
let uncompressed_bytes = decompressor.decompress(compressed_bytes.as_slice::<u8>());

let uncompressed_lens_array = self
Expand Down Expand Up @@ -58,9 +56,7 @@ impl IntoCanonical for FSSTArray {
});

let views_array: ArrayData = Buffer::<u8>::from_byte_buffer(views.into_byte_buffer()).into_array();
// TODO(ngates): return non-vec to avoid this copy
// See: https://github.com/spiraldb/fsst/issues/61
let uncompressed_bytes_array = Buffer::copy_from(uncompressed_bytes).into_array();
let uncompressed_bytes_array = ByteBuffer::from(uncompressed_bytes).into_array();

VarBinViewArray::try_new(
views_array,
Expand Down
18 changes: 8 additions & 10 deletions vortex-array/src/array/primitive/compute/slice.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use vortex_dtype::match_each_native_ptype;
use vortex_error::VortexResult;

use crate::array::primitive::PrimitiveArray;
Expand All @@ -8,15 +9,12 @@ use crate::{ArrayData, IntoArrayData};

impl SliceFn<PrimitiveArray> for PrimitiveEncoding {
fn slice(&self, array: &PrimitiveArray, start: usize, stop: usize) -> VortexResult<ArrayData> {
let byte_width = array.ptype().byte_width();
let buffer = array
.byte_buffer()
.slice(start * byte_width..stop * byte_width);
Ok(PrimitiveArray::from_byte_buffer(
buffer,
array.ptype(),
array.validity().slice(start, stop)?,
)
.into_array())
match_each_native_ptype!(array.ptype(), |$T| {
Ok(PrimitiveArray::new(
array.buffer::<$T>().slice(start..stop),
array.validity().slice(start, stop)?,
)
.into_array())
})
}
}
Loading

0 comments on commit 6287db8

Please sign in to comment.