diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 23f86dde9cd..22f7cb92466 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -58,7 +58,7 @@ jobs: - { shard: 5, name: "Core & encodings", packages: "vortex-buffer vortex-error vortex-mask vortex-compute vortex-file vortex-alp vortex-bytebool vortex-datetime-parts" } - { shard: 6, name: "Main library & storage", packages: "vortex vortex-btrblocks vortex-compressor vortex-row" } - { shard: 7, name: "FastLanes & decimals", packages: "vortex-decimal-byte-parts vortex-fastlanes", features: "--features _test-harness" } - - { shard: 8, name: "Encodings & layout", packages: "vortex-pco vortex-runend vortex-sequence vortex-sparse vortex-zigzag vortex-zstd vortex-layout" } + - { shard: 8, name: "Encodings & layout", packages: "vortex-pco vortex-sequence vortex-sparse vortex-zigzag vortex-zstd vortex-layout" } - { shard: 9, name: "Strings, tensor & spatial", packages: "vortex-fsst vortex-tensor vortex-spatial", features: "--features _test-harness" } name: "Benchmark with Codspeed (Shard #${{ matrix.shard }} - ${{ matrix.name }})" timeout-minutes: 30 diff --git a/Cargo.lock b/Cargo.lock index aa34373dd70..55ee9963734 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11357,7 +11357,6 @@ dependencies = [ "vortex-metrics", "vortex-parquet-variant", "vortex-pco", - "vortex-runend", "vortex-scan", "vortex-sequence", "vortex-session", @@ -11481,7 +11480,6 @@ dependencies = [ "vortex-fsst", "vortex-mask", "vortex-onpair", - "vortex-runend", "vortex-session", "vortex-zstd", ] @@ -11583,7 +11581,6 @@ dependencies = [ "vortex-fsst", "vortex-onpair", "vortex-pco", - "vortex-runend", "vortex-sequence", "vortex-session", "vortex-sparse", @@ -11890,7 +11887,6 @@ dependencies = [ "url", "vortex", "vortex-array", - "vortex-runend", "vortex-sequence", "vortex-spatial", "vortex-utils", @@ -12009,7 +12005,6 @@ dependencies = [ "vortex-metrics", "vortex-onpair", "vortex-pco", - "vortex-runend", "vortex-scan", "vortex-sequence", "vortex-session", @@ -12063,7 +12058,6 @@ dependencies = [ "vortex-io", "vortex-mask", "vortex-row", - "vortex-runend", "vortex-session", "vortex-utils", ] @@ -12207,7 +12201,6 @@ dependencies = [ "vortex-io", "vortex-mask", "vortex-metrics", - "vortex-runend", "vortex-scan", "vortex-sequence", "vortex-session", @@ -12378,26 +12371,6 @@ dependencies = [ "vortex-session", ] -[[package]] -name = "vortex-runend" -version = "0.1.0" -dependencies = [ - "arbitrary", - "codspeed-divan-compat", - "insta", - "itertools 0.14.0", - "mimalloc", - "num-traits", - "prost 0.14.4", - "rand 0.10.3", - "rstest", - "vortex-array", - "vortex-buffer", - "vortex-error", - "vortex-mask", - "vortex-session", -] - [[package]] name = "vortex-scan" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index a551b0f397b..d8b937ea141 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,6 @@ members = [ # Encodings "encodings/fastlanes", "encodings/decimal-byte-parts", - "encodings/runend", "encodings/sequence", "encodings/alp", "encodings/datetime-parts", @@ -331,7 +330,6 @@ vortex-onpair = { version = "0.1.0", path = "./encodings/onpair", default-featur vortex-parquet-variant = { version = "0.1.0", path = "./encodings/parquet-variant" } vortex-pco = { version = "0.1.0", path = "./encodings/pco", default-features = false } vortex-row = { version = "0.1.0", path = "./vortex-row", default-features = false } -vortex-runend = { version = "0.1.0", path = "./encodings/runend", default-features = false } vortex-scan = { version = "0.1.0", path = "./vortex-scan", default-features = false } vortex-sequence = { version = "0.1.0", path = "encodings/sequence", default-features = false } vortex-session = { version = "0.1.0", path = "./vortex-session", default-features = false } diff --git a/docs/developer-guide/internals/architecture.md b/docs/developer-guide/internals/architecture.md index 51f7b09bbbd..f72375e98fd 100644 --- a/docs/developer-guide/internals/architecture.md +++ b/docs/developer-guide/internals/architecture.md @@ -50,7 +50,6 @@ and registers itself with the session. The standard encodings are bundled into t | `vortex-alp` | Adaptive Lossless floating-Point compression | | `vortex-fastlanes` | FastLanes bit-packing, delta, and frame-of-reference | | `vortex-fsst` | Fast Static Symbol Table compression for strings | -| `vortex-runend` | Run-end encoding for repetitive data | | `vortex-sparse` | Sparse array encoding | | `vortex-zigzag` | ZigZag encoding for signed integers | | `vortex-roaring` | Roaring bitmap encoding | diff --git a/encodings/runend/Cargo.toml b/encodings/runend/Cargo.toml deleted file mode 100644 index ae1dbec2a36..00000000000 --- a/encodings/runend/Cargo.toml +++ /dev/null @@ -1,67 +0,0 @@ -[package] -name = "vortex-runend" -authors = { workspace = true } -categories = { workspace = true } -description = "Vortex run end encoded array" -edition = { workspace = true } -include = { workspace = true } -keywords = { workspace = true } -license = { workspace = true } -readme = { workspace = true } -repository = { workspace = true } -rust-version = { workspace = true } -version = { workspace = true } - -[dependencies] -arbitrary = { workspace = true, optional = true } -itertools = { workspace = true } -num-traits = { workspace = true } -prost = { workspace = true } -vortex-array = { workspace = true } -vortex-buffer = { workspace = true } -vortex-error = { workspace = true } -vortex-mask = { workspace = true } -vortex-session = { workspace = true } - -[lints] -workspace = true - -[dev-dependencies] -divan = { workspace = true } -insta = { workspace = true } -itertools = { workspace = true } -mimalloc = { workspace = true } -rand = { workspace = true } -rstest = { workspace = true } -vortex-array = { workspace = true, features = ["_test-harness"] } - -[features] -arbitrary = ["dep:arbitrary", "vortex-array/arbitrary"] - -[[bench]] -name = "run_end_null_count" -harness = false - -[[bench]] -name = "run_end_compress" -harness = false - -[[bench]] -name = "run_end_decode" -harness = false - -[[bench]] -name = "run_end_take" -harness = false - -[[bench]] -name = "run_end_filter" -harness = false - -[[bench]] -name = "run_end_sum" -harness = false - -[[bench]] -name = "run_end_decode_primitive" -harness = false diff --git a/encodings/runend/src/lib.rs b/encodings/runend/src/lib.rs deleted file mode 100644 index 98c661e6e36..00000000000 --- a/encodings/runend/src/lib.rs +++ /dev/null @@ -1,103 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: Copyright the Vortex contributors - -#[cfg(feature = "arbitrary")] -mod arbitrary; -#[cfg(feature = "arbitrary")] -pub use arbitrary::ArbitraryRunEndArray; -pub use array::*; -pub use iter::trimmed_ends_iter; - -mod array; -pub mod compress; -mod compute; -pub mod decompress_bool; -mod iter; -mod kernel; -pub mod ops; -mod probe; -mod rules; -#[cfg(test)] -#[cfg(not(codspeed))] -mod trace_tests; - -#[doc(hidden)] -pub mod _benchmarking { - pub use compute::filter::filter_run_end_primitive; - pub use compute::take::take_indices_unchecked; - - use super::*; -} - -use vortex_array::ArrayVTable; -use vortex_array::aggregate_fn::AggregateFnVTable; -use vortex_array::aggregate_fn::fns::is_constant::IsConstant; -use vortex_array::aggregate_fn::fns::is_sorted::IsSorted; -use vortex_array::aggregate_fn::fns::min_max::MinMax; -use vortex_array::aggregate_fn::fns::sum::Sum; -use vortex_array::aggregate_fn::fns::sum_v2::SumV2; -use vortex_array::aggregate_fn::session::AggregateFnSessionExt; -use vortex_array::session::ArraySessionExt; -use vortex_session::VortexSession; - -/// Initialize run-end encoding in the given session. -pub fn initialize(session: &VortexSession) { - session.arrays().register(RunEnd); - kernel::initialize(session); - - // Register the RunEnd-specific aggregate kernels. - session.aggregate_fns().register_aggregate_kernel( - RunEnd.id(), - Some(MinMax.id()), - &compute::min_max::RunEndMinMaxKernel, - ); - session.aggregate_fns().register_aggregate_kernel( - RunEnd.id(), - Some(IsConstant.id()), - &compute::is_constant::RunEndIsConstantKernel, - ); - session.aggregate_fns().register_aggregate_kernel( - RunEnd.id(), - Some(IsSorted.id()), - &compute::is_sorted::RunEndIsSortedKernel, - ); - for sum in [Sum.id(), SumV2.id()] { - session.aggregate_fns().register_aggregate_kernel( - RunEnd.id(), - Some(sum), - &compute::sum::RunEndSumKernel, - ); - } -} - -#[cfg(test)] -mod tests { - use std::sync::LazyLock; - - use prost::Message; - use vortex_array::dtype::PType; - use vortex_array::test_harness::check_metadata; - use vortex_session::VortexSession; - - use crate::RunEndMetadata; - - pub static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); - - #[cfg_attr(miri, ignore)] - #[test] - fn test_runend_metadata() { - check_metadata( - "runend.metadata", - &RunEndMetadata { - ends_ptype: PType::U64 as i32, - num_runs: u64::MAX, - offset: u64::MAX, - } - .encode_to_vec(), - ); - } -} diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index eed6fb69495..f216cf61903 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -39,7 +39,6 @@ vortex-fsst = { workspace = true, features = ["_test-harness"] } vortex-io = { workspace = true, features = ["wasm-bindgen"] } vortex-mask = { workspace = true } vortex-row = { workspace = true } -vortex-runend = { workspace = true, features = ["arbitrary"] } vortex-session = { workspace = true } vortex-utils = { workspace = true } diff --git a/fuzz/src/compress.rs b/fuzz/src/compress.rs index a8ac1a52480..15574406808 100644 --- a/fuzz/src/compress.rs +++ b/fuzz/src/compress.rs @@ -14,7 +14,7 @@ use vortex_array::IntoArray; use vortex_array::VortexSessionExecute; use vortex_array::arrays::constant::ArbitraryConstantArray; use vortex_array::arrays::dict::ArbitraryDictArray; -use vortex_runend::ArbitraryRunEndArray; +use vortex_array::arrays::runend::ArbitraryRunEndArray; use crate::SESSION; use crate::error::Backtrace; diff --git a/vortex-array/Cargo.toml b/vortex-array/Cargo.toml index 4beb0672421..809cbfafba4 100644 --- a/vortex-array/Cargo.toml +++ b/vortex-array/Cargo.toml @@ -334,3 +334,31 @@ harness = false [[bench]] name = "probe" harness = false + +[[bench]] +name = "run_end_null_count" +harness = false + +[[bench]] +name = "run_end_compress" +harness = false + +[[bench]] +name = "run_end_decode" +harness = false + +[[bench]] +name = "run_end_take" +harness = false + +[[bench]] +name = "run_end_filter" +harness = false + +[[bench]] +name = "run_end_sum" +harness = false + +[[bench]] +name = "run_end_decode_primitive" +harness = false diff --git a/encodings/runend/benches/run_end_compress.rs b/vortex-array/benches/run_end_compress.rs similarity index 94% rename from encodings/runend/benches/run_end_compress.rs rename to vortex-array/benches/run_end_compress.rs index c1935024d7a..b5d1ea378ba 100644 --- a/encodings/runend/benches/run_end_compress.rs +++ b/vortex-array/benches/run_end_compress.rs @@ -13,11 +13,11 @@ use vortex_array::RecursiveCanonical; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; use vortex_array::arrays::VarBinViewArray; +use vortex_array::arrays::runend::RunEnd; +use vortex_array::arrays::runend::compress::runend_encode; use vortex_array::dtype::IntegerPType; use vortex_array::validity::Validity; use vortex_buffer::Buffer; -use vortex_runend::RunEnd; -use vortex_runend::compress::runend_encode; use vortex_session::VortexSession; // `runend_encode` allocates its output buffers inside the timed region, so route allocation @@ -30,11 +30,7 @@ fn main() { divan::main(); } -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); // (length, run_step). The (4_000, 1024) point is left out: it flipped by 20% between runs of // identical code on more than 40 pull requests, and (10_000, 1024) and (10_000, 4096) keep long diff --git a/encodings/runend/benches/run_end_decode.rs b/vortex-array/benches/run_end_decode.rs similarity index 98% rename from encodings/runend/benches/run_end_decode.rs rename to vortex-array/benches/run_end_decode.rs index 3ca4544312d..4765fbaa5d4 100644 --- a/encodings/runend/benches/run_end_decode.rs +++ b/vortex-array/benches/run_end_decode.rs @@ -11,10 +11,10 @@ use mimalloc::MiMalloc; use vortex_array::VortexSessionExecute; use vortex_array::arrays::BoolArray; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::runend::decompress_bool::runend_decode_bools; use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::BufferMut; -use vortex_runend::decompress_bool::runend_decode_bools; use vortex_session::VortexSession; #[global_allocator] @@ -24,11 +24,7 @@ fn main() { divan::main(); } -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); /// Distribution types for bool benchmarks #[derive(Clone, Copy)] diff --git a/encodings/runend/benches/run_end_decode_primitive.rs b/vortex-array/benches/run_end_decode_primitive.rs similarity index 91% rename from encodings/runend/benches/run_end_decode_primitive.rs rename to vortex-array/benches/run_end_decode_primitive.rs index a3eb60376c8..8230dfef9f4 100644 --- a/encodings/runend/benches/run_end_decode_primitive.rs +++ b/vortex-array/benches/run_end_decode_primitive.rs @@ -15,11 +15,11 @@ use rand::SeedableRng; use rand::rngs::StdRng; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::runend::compress::runend_decode_primitive; use vortex_array::dtype::NativePType; use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::Buffer; -use vortex_runend::compress::runend_decode_primitive; use vortex_session::VortexSession; #[global_allocator] @@ -29,11 +29,7 @@ fn main() { divan::main(); } -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); const LEN: usize = 16_384; diff --git a/encodings/runend/benches/run_end_filter.rs b/vortex-array/benches/run_end_filter.rs similarity index 97% rename from encodings/runend/benches/run_end_filter.rs rename to vortex-array/benches/run_end_filter.rs index b012d43ca7d..073da7824a8 100644 --- a/encodings/runend/benches/run_end_filter.rs +++ b/vortex-array/benches/run_end_filter.rs @@ -20,8 +20,8 @@ use mimalloc::MiMalloc; use rand::SeedableRng; use rand::rngs::StdRng; use rand::seq::SliceRandom; +use vortex_array::arrays::runend::_benchmarking::filter_run_end_primitive; use vortex_buffer::BitBuffer; -use vortex_runend::_benchmarking::filter_run_end_primitive; #[global_allocator] static GLOBAL: MiMalloc = MiMalloc; diff --git a/encodings/runend/benches/run_end_null_count.rs b/vortex-array/benches/run_end_null_count.rs similarity index 89% rename from encodings/runend/benches/run_end_null_count.rs rename to vortex-array/benches/run_end_null_count.rs index af4d1e2fbb2..31f397e2920 100644 --- a/encodings/runend/benches/run_end_null_count.rs +++ b/vortex-array/benches/run_end_null_count.rs @@ -13,9 +13,9 @@ use rand::rngs::StdRng; use vortex_array::IntoArray; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::runend::RunEnd; +use vortex_array::arrays::runend::RunEndArray; use vortex_buffer::Buffer; -use vortex_runend::RunEnd; -use vortex_runend::RunEndArray; use vortex_session::VortexSession; #[global_allocator] @@ -53,11 +53,7 @@ const BENCH_ARGS: &[(usize, usize, f64)] = &[ (32_000, 1024, 0.5), ]; -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); #[divan::bench(args = BENCH_ARGS)] fn null_count_run_end(bencher: Bencher, (n, run_step, valid_density): (usize, usize, f64)) { diff --git a/encodings/runend/benches/run_end_sum.rs b/vortex-array/benches/run_end_sum.rs similarity index 87% rename from encodings/runend/benches/run_end_sum.rs rename to vortex-array/benches/run_end_sum.rs index d5a7b338922..fb938217ace 100644 --- a/encodings/runend/benches/run_end_sum.rs +++ b/vortex-array/benches/run_end_sum.rs @@ -12,17 +12,13 @@ use vortex_array::IntoArray; use vortex_array::VortexSessionExecute; use vortex_array::aggregate_fn::fns::sum_v2::sum_v2; use vortex_array::arrays::PrimitiveArray; -use vortex_runend::RunEnd; +use vortex_array::arrays::runend::RunEnd; use vortex_session::VortexSession; const LEN: usize = 2_048; const RUN_LENGTH: usize = 64; -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); #[global_allocator] static GLOBAL: MiMalloc = MiMalloc; diff --git a/encodings/runend/benches/run_end_take.rs b/vortex-array/benches/run_end_take.rs similarity index 96% rename from encodings/runend/benches/run_end_take.rs rename to vortex-array/benches/run_end_take.rs index 910f43b98c9..2128f2d50a0 100644 --- a/encodings/runend/benches/run_end_take.rs +++ b/vortex-array/benches/run_end_take.rs @@ -16,9 +16,9 @@ use vortex_array::IntoArray; use vortex_array::RecursiveCanonical; use vortex_array::VortexSessionExecute; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::runend::RunEnd; use vortex_array::validity::Validity; use vortex_buffer::Buffer; -use vortex_runend::RunEnd; use vortex_session::VortexSession; #[global_allocator] @@ -28,11 +28,7 @@ fn main() { divan::main(); } -static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session -}); +static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); #[derive(Clone, Copy)] enum IndexPattern { diff --git a/encodings/runend/goldenfiles/runend.metadata b/vortex-array/goldenfiles/runend.metadata similarity index 100% rename from encodings/runend/goldenfiles/runend.metadata rename to vortex-array/goldenfiles/runend.metadata diff --git a/vortex-array/src/aggregate_fn/session.rs b/vortex-array/src/aggregate_fn/session.rs index 9726b5e2ff4..f88db67cb03 100644 --- a/vortex-array/src/aggregate_fn/session.rs +++ b/vortex-array/src/aggregate_fn/session.rs @@ -45,10 +45,15 @@ use crate::array::VTable; use crate::arrays::Chunked; use crate::arrays::Dict; use crate::arrays::Primitive; +use crate::arrays::RunEnd; use crate::arrays::chunked::compute::aggregate::ChunkedArrayAggregate; use crate::arrays::dict::compute::is_constant::DictIsConstantKernel; use crate::arrays::dict::compute::is_sorted::DictIsSortedKernel; use crate::arrays::dict::compute::min_max::DictMinMaxKernel; +use crate::arrays::runend::compute::is_constant::RunEndIsConstantKernel; +use crate::arrays::runend::compute::is_sorted::RunEndIsSortedKernel; +use crate::arrays::runend::compute::min_max::RunEndMinMaxKernel; +use crate::arrays::runend::compute::sum::RunEndSumKernel; use crate::dtype::DType; use crate::dtype::extension::ExtVTable; use crate::extension::datetime::Date; @@ -133,6 +138,11 @@ impl Default for AggregateFnSession { this.register_aggregate_kernel(Dict.id(), Some(MinMax.id()), &DictMinMaxKernel); this.register_aggregate_kernel(Dict.id(), Some(IsConstant.id()), &DictIsConstantKernel); this.register_aggregate_kernel(Dict.id(), Some(IsSorted.id()), &DictIsSortedKernel); + this.register_aggregate_kernel(RunEnd.id(), Some(MinMax.id()), &RunEndMinMaxKernel); + this.register_aggregate_kernel(RunEnd.id(), Some(IsConstant.id()), &RunEndIsConstantKernel); + this.register_aggregate_kernel(RunEnd.id(), Some(IsSorted.id()), &RunEndIsSortedKernel); + this.register_aggregate_kernel(RunEnd.id(), Some(Sum.id()), &RunEndSumKernel); + this.register_aggregate_kernel(RunEnd.id(), Some(SumV2.id()), &RunEndSumKernel); // Register the built-in grouped aggregate kernels. this.register_grouped_kernel(Count.id(), &CountGroupedKernel); diff --git a/vortex-array/src/arrays/mod.rs b/vortex-array/src/arrays/mod.rs index ed6e272b2b1..a8ec4855e6a 100644 --- a/vortex-array/src/arrays/mod.rs +++ b/vortex-array/src/arrays/mod.rs @@ -102,6 +102,10 @@ pub mod primitive; pub use primitive::Primitive; pub use primitive::PrimitiveArray; +pub mod runend; +pub use runend::RunEnd; +pub use runend::RunEndArray; + pub mod scalar_fn; pub use scalar_fn::ScalarFn; pub use scalar_fn::ScalarFnArray; @@ -145,6 +149,7 @@ pub(crate) fn initialize(session: &VortexSession) { null::initialize(session); patched::initialize(session); primitive::initialize(session); + runend::initialize(session); struct_::initialize(session); varbin::initialize(session); varbinview::initialize(session); diff --git a/encodings/runend/src/arbitrary.rs b/vortex-array/src/arrays/runend/arbitrary.rs similarity index 91% rename from encodings/runend/src/arbitrary.rs rename to vortex-array/src/arrays/runend/arbitrary.rs index d913de378be..8950275f8e9 100644 --- a/encodings/runend/src/arbitrary.rs +++ b/vortex-array/src/arrays/runend/arbitrary.rs @@ -5,22 +5,22 @@ use arbitrary::Arbitrary; use arbitrary::Result; use arbitrary::Unstructured; use arbitrary::unstructured::Int; -use vortex_array::ArrayRef; -use vortex_array::IntoArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::arbitrary::ArbitraryArray; -use vortex_array::arrays::arbitrary::ArbitraryArrayConfig; -use vortex_array::arrays::arbitrary::ArbitraryWith; -use vortex_array::dtype::DType; -use vortex_array::dtype::Nullability; -use vortex_array::dtype::PType; -use vortex_array::dtype::UnsignedPType; -use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_error::VortexExpect; -use crate::RunEnd; -use crate::RunEndArray; +use crate::ArrayRef; +use crate::IntoArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::arbitrary::ArbitraryArray; +use crate::arrays::arbitrary::ArbitraryArrayConfig; +use crate::arrays::arbitrary::ArbitraryWith; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::RunEndArray; +use crate::dtype::DType; +use crate::dtype::Nullability; +use crate::dtype::PType; +use crate::dtype::UnsignedPType; +use crate::validity::Validity; /// A wrapper type to implement `Arbitrary` for `RunEndArray`. #[derive(Clone, Debug)] diff --git a/encodings/runend/src/array.rs b/vortex-array/src/arrays/runend/array.rs similarity index 92% rename from encodings/runend/src/array.rs rename to vortex-array/src/arrays/runend/array.rs index 0d8daa9b35b..8a4db245e75 100644 --- a/encodings/runend/src/array.rs +++ b/vortex-array/src/arrays/runend/array.rs @@ -8,36 +8,6 @@ use std::hash::Hash; use std::hash::Hasher; use prost::Message; -use vortex_array::AnyCanonical; -use vortex_array::Array; -use vortex_array::ArrayEq; -use vortex_array::ArrayHash; -use vortex_array::ArrayId; -use vortex_array::ArrayParts; -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::EqMode; -use vortex_array::ExecutionCtx; -use vortex_array::ExecutionResult; -use vortex_array::IntoArray; -use vortex_array::TypedArrayRef; -use vortex_array::VortexSessionExecute; -use vortex_array::array_slots; -use vortex_array::arrays::DecimalArray; -use vortex_array::arrays::ListViewArray; -use vortex_array::arrays::Primitive; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::VarBinViewArray; -use vortex_array::arrays::listview::ListViewArraySlotsExt; -use vortex_array::buffer::BufferHandle; -use vortex_array::dtype::DType; -use vortex_array::dtype::Nullability; -use vortex_array::dtype::PType; -use vortex_array::require_child; -use vortex_array::serde::ArrayChildren; -use vortex_array::validity::Validity; -use vortex_array::vtable::VTable; -use vortex_array::vtable::ValidityVTable; use vortex_error::VortexExpect as _; use vortex_error::VortexResult; use vortex_error::vortex_bail; @@ -47,14 +17,44 @@ use vortex_error::vortex_panic; use vortex_session::VortexSession; use vortex_session::registry::CachedId; -use crate::compress::runend_decode_decimal; -use crate::compress::runend_decode_primitive; -use crate::compress::runend_decode_varbinview; -use crate::compress::runend_encode; -use crate::decompress_bool::runend_decode_bools; -use crate::ops::find_physical_index; -use crate::ops::find_slice_end_index; -use crate::rules::RULES; +use crate::AnyCanonical; +use crate::Array; +use crate::ArrayEq; +use crate::ArrayHash; +use crate::ArrayId; +use crate::ArrayParts; +use crate::ArrayRef; +use crate::ArrayView; +use crate::EqMode; +use crate::ExecutionCtx; +use crate::ExecutionResult; +use crate::IntoArray; +use crate::TypedArrayRef; +use crate::VortexSessionExecute; +use crate::array_slots; +use crate::arrays::DecimalArray; +use crate::arrays::ListViewArray; +use crate::arrays::Primitive; +use crate::arrays::PrimitiveArray; +use crate::arrays::VarBinViewArray; +use crate::arrays::listview::ListViewArraySlotsExt; +use crate::arrays::runend::compress::runend_decode_decimal; +use crate::arrays::runend::compress::runend_decode_primitive; +use crate::arrays::runend::compress::runend_decode_varbinview; +use crate::arrays::runend::compress::runend_encode; +use crate::arrays::runend::decompress_bool::runend_decode_bools; +use crate::arrays::runend::ops::find_physical_index; +use crate::arrays::runend::ops::find_slice_end_index; +use crate::arrays::runend::rules::RULES; +use crate::buffer::BufferHandle; +use crate::dtype::DType; +use crate::dtype::Nullability; +use crate::dtype::PType; +use crate::require_child; +use crate::serde::ArrayChildren; +use crate::validity::Validity; +use crate::vtable::VTable; +use crate::vtable::ValidityVTable; /// A [`RunEnd`]-encoded Vortex array. pub type RunEndArray = Array; @@ -124,7 +124,7 @@ impl VTable for RunEnd { array: ArrayView<'_, Self>, buffers: &[BufferHandle], ) -> VortexResult> { - vortex_array::vtable::with_empty_buffers(self, array, buffers) + crate::vtable::with_empty_buffers(self, array, buffers) } fn serialize( @@ -420,14 +420,13 @@ impl RunEndData { /// /// ``` /// # use vortex_array::arrays::BoolArray; + /// # use vortex_array::arrays::runend::RunEnd; /// # use vortex_array::IntoArray; /// # use vortex_array::VortexSessionExecute; /// # use vortex_buffer::buffer; /// # use vortex_error::VortexResult; - /// # use vortex_runend::RunEnd; /// # fn main() -> VortexResult<()> { /// let session = vortex_array::array_session(); - /// vortex_runend::initialize(&session); /// let mut ctx = session.create_execution_ctx(); /// let ends = buffer![2u8, 3u8].into_array(); /// let values = BoolArray::from_iter([false, true]).into_array(); @@ -574,33 +573,29 @@ mod tests { use std::sync::Arc; use std::sync::LazyLock; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::DecimalArray; - use vortex_array::arrays::DictArray; - use vortex_array::arrays::ListArray; - use vortex_array::arrays::ListViewArray; - use vortex_array::arrays::VarBinViewArray; - use vortex_array::arrays::listview::ListViewArraySlotsExt; - use vortex_array::assert_arrays_eq; - use vortex_array::builders::VarBinBuilder; - use vortex_array::dtype::DType; - use vortex_array::dtype::DecimalDType; - use vortex_array::dtype::Nullability; - use vortex_array::dtype::PType; - use vortex_array::dtype::i256; - use vortex_array::validity::Validity; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_session::VortexSession; - use crate::RunEnd; - - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::DecimalArray; + use crate::arrays::DictArray; + use crate::arrays::ListArray; + use crate::arrays::ListViewArray; + use crate::arrays::VarBinViewArray; + use crate::arrays::listview::ListViewArraySlotsExt; + use crate::arrays::runend::RunEnd; + use crate::assert_arrays_eq; + use crate::builders::VarBinBuilder; + use crate::dtype::DType; + use crate::dtype::DecimalDType; + use crate::dtype::Nullability; + use crate::dtype::PType; + use crate::dtype::i256; + use crate::validity::Validity; + + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[test] fn test_runend_constructor() { diff --git a/encodings/runend/src/compress.rs b/vortex-array/src/arrays/runend/compress.rs similarity index 92% rename from encodings/runend/src/compress.rs rename to vortex-array/src/arrays/runend/compress.rs index 6d4ebd98c33..30cdbade483 100644 --- a/encodings/runend/src/compress.rs +++ b/vortex-array/src/arrays/runend/compress.rs @@ -2,29 +2,6 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use itertools::Itertools; -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::BoolArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::DecimalArray; -use vortex_array::arrays::Primitive; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::VarBinViewArray; -use vortex_array::arrays::bool::BoolArrayExt; -use vortex_array::arrays::decimal::DecimalArrayExt; -use vortex_array::arrays::primitive::PrimitiveArrayExt; -use vortex_array::buffer::BufferHandle; -use vortex_array::dtype::NativePType; -use vortex_array::dtype::Nullability; -use vortex_array::expr::stats::Precision; -use vortex_array::expr::stats::Stat; -use vortex_array::match_each_decimal_value_type; -use vortex_array::match_each_native_ptype; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::scalar::Scalar; -use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::BitBufferMut; use vortex_buffer::Buffer; @@ -34,7 +11,30 @@ use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::Mask; -use crate::iter::trimmed_ends_iter; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::BoolArray; +use crate::arrays::ConstantArray; +use crate::arrays::DecimalArray; +use crate::arrays::Primitive; +use crate::arrays::PrimitiveArray; +use crate::arrays::VarBinViewArray; +use crate::arrays::bool::BoolArrayExt; +use crate::arrays::decimal::DecimalArrayExt; +use crate::arrays::primitive::PrimitiveArrayExt; +use crate::arrays::runend::iter::trimmed_ends_iter; +use crate::buffer::BufferHandle; +use crate::dtype::NativePType; +use crate::dtype::Nullability; +use crate::expr::stats::Precision; +use crate::expr::stats::Stat; +use crate::match_each_decimal_value_type; +use crate::match_each_native_ptype; +use crate::match_each_unsigned_integer_ptype; +use crate::scalar::Scalar; +use crate::validity::Validity; /// Run-end encode a `PrimitiveArray`, returning a tuple of `(ends, values)`. pub fn runend_encode( @@ -432,23 +432,19 @@ mod tests { use std::sync::LazyLock; use rstest::rstest; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_session::VortexSession; - use crate::compress::runend_decode_primitive; - use crate::compress::runend_encode; + use crate::VortexSessionExecute; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::compress::runend_decode_primitive; + use crate::arrays::runend::compress::runend_encode; + use crate::assert_arrays_eq; + use crate::validity::Validity; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[test] fn encode() -> VortexResult<()> { diff --git a/encodings/runend/src/compute/cast.rs b/vortex-array/src/arrays/runend/compute/cast.rs similarity index 76% rename from encodings/runend/src/compute/cast.rs rename to vortex-array/src/arrays/runend/compute/cast.rs index 2d81b017eeb..d9d1d6ec076 100644 --- a/encodings/runend/src/compute/cast.rs +++ b/vortex-array/src/arrays/runend/compute/cast.rs @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::IntoArray; -use vortex_array::builtins::ArrayBuiltins; -use vortex_array::dtype::DType; -use vortex_array::scalar_fn::fns::cast::CastReduce; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ArrayView; +use crate::IntoArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::builtins::ArrayBuiltins; +use crate::dtype::DType; +use crate::scalar_fn::fns::cast::CastReduce; impl CastReduce for RunEnd { fn cast(array: ArrayView<'_, Self>, dtype: &DType) -> VortexResult> { // Cast the values array to the target type @@ -37,27 +37,23 @@ mod tests { use std::sync::LazyLock; use rstest::rstest; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::BoolArray; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::builtins::ArrayBuiltins; - use vortex_array::compute::conformance::cast::test_cast_conformance; - use vortex_array::dtype::DType; - use vortex_array::dtype::Nullability; - use vortex_array::dtype::PType; use vortex_buffer::buffer; use vortex_session::VortexSession; - use crate::RunEnd; - use crate::RunEndArray; - - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::BoolArray; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::assert_arrays_eq; + use crate::builtins::ArrayBuiltins; + use crate::compute::conformance::cast::test_cast_conformance; + use crate::dtype::DType; + use crate::dtype::Nullability; + use crate::dtype::PType; + + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[test] fn test_cast_runend_i32_to_i64() { @@ -152,30 +148,30 @@ mod tests { ); } - type RunEndBuilder = fn(&mut vortex_array::ExecutionCtx) -> RunEndArray; + type RunEndBuilder = fn(&mut crate::ExecutionCtx) -> RunEndArray; #[rstest] - #[case(|ctx: &mut vortex_array::ExecutionCtx| RunEnd::try_new( + #[case(|ctx: &mut crate::ExecutionCtx| RunEnd::try_new( buffer![3u64, 5, 8].into_array(), buffer![100i32, 200, 300].into_array(), ctx, ).unwrap())] - #[case(|ctx: &mut vortex_array::ExecutionCtx| RunEnd::try_new( + #[case(|ctx: &mut crate::ExecutionCtx| RunEnd::try_new( buffer![1u64, 4, 10].into_array(), buffer![1.5f32, 2.5, 3.5].into_array(), ctx, ).unwrap())] - #[case(|ctx: &mut vortex_array::ExecutionCtx| RunEnd::try_new( + #[case(|ctx: &mut crate::ExecutionCtx| RunEnd::try_new( buffer![2u64, 3, 5].into_array(), PrimitiveArray::from_option_iter([Some(42i32), None, Some(84)]).into_array(), ctx, ).unwrap())] - #[case(|ctx: &mut vortex_array::ExecutionCtx| RunEnd::try_new( + #[case(|ctx: &mut crate::ExecutionCtx| RunEnd::try_new( buffer![10u64].into_array(), buffer![255u8].into_array(), ctx, ).unwrap())] - #[case(|ctx: &mut vortex_array::ExecutionCtx| RunEnd::try_new( + #[case(|ctx: &mut crate::ExecutionCtx| RunEnd::try_new( buffer![2u64, 4, 6, 8, 10].into_array(), BoolArray::from_iter(vec![true, false, true, false, true]).into_array(), ctx, diff --git a/encodings/runend/src/compute/compare.rs b/vortex-array/src/arrays/runend/compute/compare.rs similarity index 60% rename from encodings/runend/src/compute/compare.rs rename to vortex-array/src/arrays/runend/compute/compare.rs index f3facb1167a..84e166d6c8f 100644 --- a/encodings/runend/src/compute/compare.rs +++ b/vortex-array/src/arrays/runend/compute/compare.rs @@ -1,23 +1,23 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::BoolArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::builtins::ArrayBuiltins; -use vortex_array::scalar_fn::fns::binary::CompareKernel; -use vortex_array::scalar_fn::fns::operators::CompareOperator; -use vortex_array::scalar_fn::fns::operators::Operator; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; -use crate::decompress_bool::runend_decode_bools; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::BoolArray; +use crate::arrays::ConstantArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::arrays::runend::decompress_bool::runend_decode_bools; +use crate::builtins::ArrayBuiltins; +use crate::scalar_fn::fns::binary::CompareKernel; +use crate::scalar_fn::fns::operators::CompareOperator; +use crate::scalar_fn::fns::operators::Operator; impl CompareKernel for RunEnd { fn compare( @@ -51,25 +51,21 @@ impl CompareKernel for RunEnd { mod test { use std::sync::LazyLock; - use vortex_array::ExecutionCtx; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::BoolArray; - use vortex_array::arrays::ConstantArray; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::builtins::ArrayBuiltins; - use vortex_array::scalar_fn::fns::operators::Operator; use vortex_session::VortexSession; - use crate::RunEnd; - use crate::RunEndArray; + use crate::ExecutionCtx; + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::BoolArray; + use crate::arrays::ConstantArray; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::assert_arrays_eq; + use crate::builtins::ArrayBuiltins; + use crate::scalar_fn::fns::operators::Operator; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(crate::array_session); fn ree_array(ctx: &mut ExecutionCtx) -> RunEndArray { RunEnd::encode( diff --git a/encodings/runend/src/compute/fill_null.rs b/vortex-array/src/arrays/runend/compute/fill_null.rs similarity index 69% rename from encodings/runend/src/compute/fill_null.rs rename to vortex-array/src/arrays/runend/compute/fill_null.rs index 90284be3e51..2e519e088fa 100644 --- a/encodings/runend/src/compute/fill_null.rs +++ b/vortex-array/src/arrays/runend/compute/fill_null.rs @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::IntoArray; -use vortex_array::builtins::ArrayBuiltins; -use vortex_array::scalar::Scalar; -use vortex_array::scalar_fn::fns::fill_null::FillNullReduce; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ArrayView; +use crate::IntoArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::builtins::ArrayBuiltins; +use crate::scalar::Scalar; +use crate::scalar_fn::fns::fill_null::FillNullReduce; impl FillNullReduce for RunEnd { fn fill_null( diff --git a/encodings/runend/src/compute/filter.rs b/vortex-array/src/arrays/runend/compute/filter.rs similarity index 90% rename from encodings/runend/src/compute/filter.rs rename to vortex-array/src/arrays/runend/compute/filter.rs index d4b4df3b2b0..180fbfd4b51 100644 --- a/encodings/runend/src/compute/filter.rs +++ b/vortex-array/src/arrays/runend/compute/filter.rs @@ -6,25 +6,25 @@ use std::ops::AddAssign; use num_traits::AsPrimitive; use num_traits::NumCast; -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::filter::FilterKernel; -use vortex_array::dtype::NativePType; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::buffer_mut; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::Mask; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; -use crate::compute::take::take_indices_unchecked; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::filter::FilterKernel; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::arrays::runend::compute::take::take_indices_unchecked; +use crate::dtype::NativePType; +use crate::match_each_unsigned_integer_ptype; +use crate::validity::Validity; /// Takes directly below this average number of selected rows per source run. /// @@ -146,16 +146,16 @@ pub fn filter_run_end_primitive + AsPrim #[cfg(test)] mod tests { - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; use vortex_error::VortexResult; use vortex_mask::Mask; - use crate::RunEnd; - use crate::RunEndArray; - use crate::tests::SESSION; + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::arrays::runend::tests::SESSION; + use crate::assert_arrays_eq; fn ree_array() -> RunEndArray { RunEnd::encode( diff --git a/encodings/runend/src/compute/is_constant.rs b/vortex-array/src/arrays/runend/compute/is_constant.rs similarity index 69% rename from encodings/runend/src/compute/is_constant.rs rename to vortex-array/src/arrays/runend/compute/is_constant.rs index 710fb7a3712..a306426ce47 100644 --- a/encodings/runend/src/compute/is_constant.rs +++ b/vortex-array/src/arrays/runend/compute/is_constant.rs @@ -1,17 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ExecutionCtx; -use vortex_array::aggregate_fn::AggregateFnRef; -use vortex_array::aggregate_fn::fns::is_constant::IsConstant; -use vortex_array::aggregate_fn::fns::is_constant::is_constant; -use vortex_array::aggregate_fn::kernels::DynAggregateKernel; -use vortex_array::scalar::Scalar; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ExecutionCtx; +use crate::aggregate_fn::AggregateFnRef; +use crate::aggregate_fn::fns::is_constant::IsConstant; +use crate::aggregate_fn::fns::is_constant::is_constant; +use crate::aggregate_fn::kernels::DynAggregateKernel; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::scalar::Scalar; /// RunEnd-specific is_constant kernel. /// diff --git a/encodings/runend/src/compute/is_sorted.rs b/vortex-array/src/arrays/runend/compute/is_sorted.rs similarity index 73% rename from encodings/runend/src/compute/is_sorted.rs rename to vortex-array/src/arrays/runend/compute/is_sorted.rs index 17ae94272cb..d9e489654f7 100644 --- a/encodings/runend/src/compute/is_sorted.rs +++ b/vortex-array/src/arrays/runend/compute/is_sorted.rs @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::Canonical; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray as _; -use vortex_array::aggregate_fn::AggregateFnRef; -use vortex_array::aggregate_fn::fns::is_sorted::IsSorted; -use vortex_array::aggregate_fn::fns::is_sorted::is_sorted; -use vortex_array::aggregate_fn::fns::is_sorted::is_strict_sorted; -use vortex_array::aggregate_fn::kernels::DynAggregateKernel; -use vortex_array::scalar::Scalar; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::Canonical; +use crate::ExecutionCtx; +use crate::IntoArray as _; +use crate::aggregate_fn::AggregateFnRef; +use crate::aggregate_fn::fns::is_sorted::IsSorted; +use crate::aggregate_fn::fns::is_sorted::is_sorted; +use crate::aggregate_fn::fns::is_sorted::is_strict_sorted; +use crate::aggregate_fn::kernels::DynAggregateKernel; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::scalar::Scalar; /// RunEnd-specific is_sorted kernel. /// diff --git a/encodings/runend/src/compute/min_max.rs b/vortex-array/src/arrays/runend/compute/min_max.rs similarity index 72% rename from encodings/runend/src/compute/min_max.rs rename to vortex-array/src/arrays/runend/compute/min_max.rs index d17c5b3c65c..fc4f58bc227 100644 --- a/encodings/runend/src/compute/min_max.rs +++ b/vortex-array/src/arrays/runend/compute/min_max.rs @@ -1,18 +1,18 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ExecutionCtx; -use vortex_array::aggregate_fn::AggregateFnRef; -use vortex_array::aggregate_fn::fns::min_max::MinMax; -use vortex_array::aggregate_fn::fns::min_max::make_minmax_dtype; -use vortex_array::aggregate_fn::fns::min_max::min_max; -use vortex_array::aggregate_fn::kernels::DynAggregateKernel; -use vortex_array::scalar::Scalar; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ExecutionCtx; +use crate::aggregate_fn::AggregateFnRef; +use crate::aggregate_fn::fns::min_max::MinMax; +use crate::aggregate_fn::fns::min_max::make_minmax_dtype; +use crate::aggregate_fn::fns::min_max::min_max; +use crate::aggregate_fn::kernels::DynAggregateKernel; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::scalar::Scalar; /// RunEnd-specific min/max kernel. /// diff --git a/encodings/runend/src/compute/mod.rs b/vortex-array/src/arrays/runend/compute/mod.rs similarity index 79% rename from encodings/runend/src/compute/mod.rs rename to vortex-array/src/arrays/runend/compute/mod.rs index 296ab525952..736d1d21c70 100644 --- a/encodings/runend/src/compute/mod.rs +++ b/vortex-array/src/arrays/runend/compute/mod.rs @@ -17,21 +17,17 @@ mod tests { use std::sync::LazyLock; use rstest::rstest; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::compute::conformance::consistency::test_array_consistency; use vortex_buffer::buffer; use vortex_session::VortexSession; - use crate::RunEnd; - use crate::RunEndArray; + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::compute::conformance::consistency::test_array_consistency; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[rstest] // Simple run-end arrays diff --git a/encodings/runend/src/compute/sum/kernel.rs b/vortex-array/src/arrays/runend/compute/sum/kernel.rs similarity index 84% rename from encodings/runend/src/compute/sum/kernel.rs rename to vortex-array/src/arrays/runend/compute/sum/kernel.rs index 6f65f96e3f1..30a0c02de0d 100644 --- a/encodings/runend/src/compute/sum/kernel.rs +++ b/vortex-array/src/arrays/runend/compute/sum/kernel.rs @@ -7,22 +7,6 @@ use std::ops::Range; -use vortex_array::ArrayRef; -use vortex_array::ExecutionCtx; -use vortex_array::aggregate_fn::AggregateFnRef; -use vortex_array::aggregate_fn::NumericalAggregateOpts; -use vortex_array::aggregate_fn::fns::sum::Sum; -use vortex_array::aggregate_fn::fns::sum_v2::SumV2; -use vortex_array::aggregate_fn::kernels::DynAggregateKernel; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::dtype::DType; -use vortex_array::dtype::NativePType; -use vortex_array::dtype::Nullability::Nullable; -use vortex_array::dtype::UnsignedPType; -use vortex_array::match_each_native_ptype; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::scalar::PValue; -use vortex_array::scalar::Scalar; use vortex_error::VortexExpect; use vortex_error::VortexResult; use vortex_mask::Mask; @@ -31,9 +15,25 @@ use super::runs::add_float_run; use super::runs::add_signed_run; use super::runs::add_unsigned_run; use super::runs::sum_range; -use crate::RunEnd; -use crate::RunEndArrayExt; -use crate::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ExecutionCtx; +use crate::aggregate_fn::AggregateFnRef; +use crate::aggregate_fn::NumericalAggregateOpts; +use crate::aggregate_fn::fns::sum::Sum; +use crate::aggregate_fn::fns::sum_v2::SumV2; +use crate::aggregate_fn::kernels::DynAggregateKernel; +use crate::arrays::PrimitiveArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::RunEndArrayExt; +use crate::arrays::runend::RunEndArraySlotsExt; +use crate::dtype::DType; +use crate::dtype::NativePType; +use crate::dtype::Nullability::Nullable; +use crate::dtype::UnsignedPType; +use crate::match_each_native_ptype; +use crate::match_each_unsigned_integer_ptype; +use crate::scalar::PValue; +use crate::scalar::Scalar; /// Whole-array primitive sum kernel for [`RunEnd`]. #[derive(Debug)] diff --git a/encodings/runend/src/compute/sum/mod.rs b/vortex-array/src/arrays/runend/compute/sum/mod.rs similarity index 100% rename from encodings/runend/src/compute/sum/mod.rs rename to vortex-array/src/arrays/runend/compute/sum/mod.rs diff --git a/encodings/runend/src/compute/sum/runs.rs b/vortex-array/src/arrays/runend/compute/sum/runs.rs similarity index 98% rename from encodings/runend/src/compute/sum/runs.rs rename to vortex-array/src/arrays/runend/compute/sum/runs.rs index fd40da33e4b..5e8762f55e9 100644 --- a/encodings/runend/src/compute/sum/runs.rs +++ b/vortex-array/src/arrays/runend/compute/sum/runs.rs @@ -19,12 +19,13 @@ use std::ops::Range; use num_traits::AsPrimitive; use num_traits::ToPrimitive; -use vortex_array::dtype::NativePType; -use vortex_array::dtype::UnsignedPType; use vortex_error::VortexExpect; use vortex_mask::Mask; use vortex_mask::MaskValues; +use crate::dtype::NativePType; +use crate::dtype::UnsignedPType; + /// Return `None` if the run's product or the accumulated sum exceeds `u64`. pub(super) fn add_unsigned_run>(sum: u64, value: T, len: usize) -> Option { value diff --git a/encodings/runend/src/compute/sum/tests.rs b/vortex-array/src/arrays/runend/compute/sum/tests.rs similarity index 89% rename from encodings/runend/src/compute/sum/tests.rs rename to vortex-array/src/arrays/runend/compute/sum/tests.rs index b23a12b6ecb..fde7c60c154 100644 --- a/encodings/runend/src/compute/sum/tests.rs +++ b/vortex-array/src/arrays/runend/compute/sum/tests.rs @@ -4,26 +4,6 @@ use std::ops::Range; use rstest::rstest; -use vortex_array::ArrayRef; -use vortex_array::IntoArray; -use vortex_array::VortexSessionExecute; -use vortex_array::aggregate_fn::AggregateFnVTableExt; -use vortex_array::aggregate_fn::NumericalAggregateOpts; -use vortex_array::aggregate_fn::fns::sum::Sum; -use vortex_array::aggregate_fn::fns::sum_v2::SumV2; -use vortex_array::aggregate_fn::kernels::DynAggregateKernel; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::DecimalArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::dtype::DType; -use vortex_array::dtype::DecimalDType; -use vortex_array::dtype::Nullability::NonNullable; -use vortex_array::dtype::Nullability::Nullable; -use vortex_array::dtype::PType; -use vortex_array::scalar::Scalar; -#[cfg(not(codspeed))] -use vortex_array::test_harness::trace::trace_op; -use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::buffer; use vortex_error::VortexExpect; @@ -33,8 +13,28 @@ use vortex_mask::Mask; use super::RunEndSumKernel; use super::runs::add_unsigned_run; use super::runs::sum_range; -use crate::RunEnd; -use crate::tests::SESSION; +use crate::ArrayRef; +use crate::IntoArray; +use crate::VortexSessionExecute; +use crate::aggregate_fn::AggregateFnVTableExt; +use crate::aggregate_fn::NumericalAggregateOpts; +use crate::aggregate_fn::fns::sum::Sum; +use crate::aggregate_fn::fns::sum_v2::SumV2; +use crate::aggregate_fn::kernels::DynAggregateKernel; +use crate::arrays::ConstantArray; +use crate::arrays::DecimalArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::tests::SESSION; +use crate::dtype::DType; +use crate::dtype::DecimalDType; +use crate::dtype::Nullability::NonNullable; +use crate::dtype::Nullability::Nullable; +use crate::dtype::PType; +use crate::scalar::Scalar; +#[cfg(not(codspeed))] +use crate::test_harness::trace::trace_op; +use crate::validity::Validity; /// Compare registered dispatch and the direct kernel with a decoded primitive reference. #[track_caller] diff --git a/encodings/runend/src/compute/take.rs b/vortex-array/src/arrays/runend/compute/take.rs similarity index 95% rename from encodings/runend/src/compute/take.rs rename to vortex-array/src/arrays/runend/compute/take.rs index 54d1639cbc6..d1af9205e5f 100644 --- a/encodings/runend/src/compute/take.rs +++ b/vortex-array/src/arrays/runend/compute/take.rs @@ -3,18 +3,6 @@ use num_traits::AsPrimitive; use num_traits::NumCast; -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::dict::TakeExecute; -use vortex_array::dtype::UnsignedPType; -use vortex_array::match_each_integer_ptype; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::scalar::Scalar; -use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::BufferMut; use vortex_error::VortexResult; @@ -22,10 +10,22 @@ use vortex_error::vortex_bail; use vortex_mask::AllOr; use vortex_mask::Mask; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; -use crate::iter::trimmed_ends_iter; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::ConstantArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::dict::TakeExecute; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::arrays::runend::iter::trimmed_ends_iter; +use crate::dtype::UnsignedPType; +use crate::match_each_integer_ptype; +use crate::match_each_unsigned_integer_ptype; +use crate::scalar::Scalar; +use crate::validity::Validity; const SORTED_LINEAR_RUNS_PER_INDEX_THRESHOLD: usize = 16; const UNSORTED_LINEAR_RUNS_PER_INDEX_THRESHOLD: usize = 4; @@ -488,15 +488,6 @@ mod tests { use std::sync::LazyLock; use rstest::rstest; - use vortex_array::ArrayRef; - use vortex_array::Canonical; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::BoolArray; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::compute::conformance::take::test_take_conformance; - use vortex_array::validity::Validity; use vortex_buffer::buffer; use vortex_mask::Mask; use vortex_session::VortexSession; @@ -505,14 +496,19 @@ mod tests { use super::physical_indices_linear_sorted; use super::physical_indices_linear_unsorted; use super::physical_indices_table; - use crate::RunEnd; - use crate::RunEndArray; - - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + use crate::ArrayRef; + use crate::Canonical; + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::BoolArray; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::assert_arrays_eq; + use crate::compute::conformance::take::test_take_conformance; + use crate::validity::Validity; + + static SESSION: LazyLock = LazyLock::new(crate::array_session); fn ree_array() -> RunEndArray { RunEnd::encode( diff --git a/encodings/runend/src/compute/take_from.rs b/vortex-array/src/arrays/runend/compute/take_from.rs similarity index 84% rename from encodings/runend/src/compute/take_from.rs rename to vortex-array/src/arrays/runend/compute/take_from.rs index 05d347a9264..9916a1d1f06 100644 --- a/encodings/runend/src/compute/take_from.rs +++ b/vortex-array/src/arrays/runend/compute/take_from.rs @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::Dict; -use vortex_array::arrays::dict::DictArraySlotsExt; -use vortex_array::dtype::DType; -use vortex_array::kernel::ExecuteParentKernel; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::Dict; +use crate::arrays::dict::DictArraySlotsExt; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::dtype::DType; +use crate::kernel::ExecuteParentKernel; #[derive(Debug)] pub(crate) struct RunEndTakeFrom; @@ -55,27 +55,23 @@ impl ExecuteParentKernel for RunEndTakeFrom { mod tests { use std::sync::LazyLock; - use vortex_array::ExecutionCtx; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::DictArray; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::kernel::ExecuteParentKernel; use vortex_buffer::buffer; use vortex_error::VortexResult; use vortex_session::VortexSession; - use crate::RunEnd; - use crate::RunEndArray; - use crate::array::RunEndArraySlotsExt; - use crate::compute::take_from::RunEndTakeFrom; - - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + use crate::ExecutionCtx; + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::arrays::DictArray; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::arrays::runend::RunEndArray; + use crate::arrays::runend::array::RunEndArraySlotsExt; + use crate::arrays::runend::compute::take_from::RunEndTakeFrom; + use crate::assert_arrays_eq; + use crate::kernel::ExecuteParentKernel; + + static SESSION: LazyLock = LazyLock::new(crate::array_session); /// Build a DictArray whose codes are run-end encoded. /// diff --git a/encodings/runend/src/decompress_bool.rs b/vortex-array/src/arrays/runend/decompress_bool.rs similarity index 93% rename from encodings/runend/src/decompress_bool.rs rename to vortex-array/src/arrays/runend/decompress_bool.rs index b74e5200e60..e49a153a2d8 100644 --- a/encodings/runend/src/decompress_bool.rs +++ b/vortex-array/src/arrays/runend/decompress_bool.rs @@ -7,24 +7,24 @@ //! (0s or 1s) and only fills the minority runs, minimizing work for skewed distributions. use itertools::Itertools; -use vortex_array::ArrayRef; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::BoolArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::bool::BoolArrayExt; -use vortex_array::dtype::DType; -use vortex_array::dtype::Nullability; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::scalar::Scalar; -use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_buffer::BitBufferMut; use vortex_error::VortexResult; use vortex_mask::Mask; -use crate::iter::trimmed_ends_iter; +use crate::ArrayRef; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::BoolArray; +use crate::arrays::ConstantArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::bool::BoolArrayExt; +use crate::arrays::runend::iter::trimmed_ends_iter; +use crate::dtype::DType; +use crate::dtype::Nullability; +use crate::match_each_unsigned_integer_ptype; +use crate::scalar::Scalar; +use crate::validity::Validity; /// Threshold for number of runs below which we use sequential append instead of prefill. /// With few runs, the overhead of prefilling the entire buffer dominates. @@ -103,7 +103,7 @@ pub fn runend_decode_typed_bool( /// for small numbers of runs. #[allow(clippy::inline_always)] #[inline(always)] -fn decode_few_runs_no_offset( +fn decode_few_runs_no_offset( ends: &[E], values: &BitBuffer, validity: Mask, @@ -250,22 +250,18 @@ fn decode_nullable_sequential( mod tests { use std::sync::LazyLock; - use vortex_array::VortexSessionExecute; - use vortex_array::arrays::BoolArray; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::validity::Validity; use vortex_buffer::BitBuffer; use vortex_error::VortexResult; use vortex_session::VortexSession; use super::runend_decode_bools; + use crate::VortexSessionExecute; + use crate::arrays::BoolArray; + use crate::arrays::PrimitiveArray; + use crate::assert_arrays_eq; + use crate::validity::Validity; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[test] fn decode_bools_alternating() -> VortexResult<()> { @@ -356,7 +352,7 @@ mod tests { #[test] fn decode_bools_nullable() -> VortexResult<()> { - use vortex_array::validity::Validity; + use crate::validity::Validity; let mut ctx = SESSION.create_execution_ctx(); // 3 runs: T (valid), F (null), T (valid) -> [T, T, null, null, null, T, T, T, T, T] diff --git a/encodings/runend/src/iter.rs b/vortex-array/src/arrays/runend/iter.rs similarity index 96% rename from encodings/runend/src/iter.rs rename to vortex-array/src/arrays/runend/iter.rs index 0e2f9bc30f7..d41ee2da87c 100644 --- a/encodings/runend/src/iter.rs +++ b/vortex-array/src/arrays/runend/iter.rs @@ -3,9 +3,10 @@ use std::cmp::min; -use vortex_array::dtype::IntegerPType; use vortex_error::vortex_panic; +use crate::dtype::IntegerPType; + pub fn trimmed_ends_iter( run_ends: &[E], offset: usize, diff --git a/encodings/runend/src/kernel.rs b/vortex-array/src/arrays/runend/kernel.rs similarity index 73% rename from encodings/runend/src/kernel.rs rename to vortex-array/src/arrays/runend/kernel.rs index 2eed964e3a9..cb5ce320c46 100644 --- a/encodings/runend/src/kernel.rs +++ b/vortex-array/src/arrays/runend/kernel.rs @@ -3,29 +3,29 @@ use std::ops::Range; -use vortex_array::ArrayRef; -use vortex_array::ArrayVTable; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::Dict; -use vortex_array::arrays::Filter; -use vortex_array::arrays::Slice; -use vortex_array::arrays::dict::TakeExecuteAdaptor; -use vortex_array::arrays::filter::FilterExecuteAdaptor; -use vortex_array::kernel::ExecuteParentKernel; -use vortex_array::optimizer::kernels::ArrayKernelsExt; -use vortex_array::scalar_fn::ScalarFnVTable; -use vortex_array::scalar_fn::fns::binary::Binary; -use vortex_array::scalar_fn::fns::binary::CompareExecuteAdaptor; use vortex_error::VortexResult; use vortex_session::VortexSession; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; -use crate::compute::take_from::RunEndTakeFrom; +use crate::ArrayRef; +use crate::ArrayVTable; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::ConstantArray; +use crate::arrays::Dict; +use crate::arrays::Filter; +use crate::arrays::Slice; +use crate::arrays::dict::TakeExecuteAdaptor; +use crate::arrays::filter::FilterExecuteAdaptor; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::arrays::runend::compute::take_from::RunEndTakeFrom; +use crate::kernel::ExecuteParentKernel; +use crate::optimizer::kernels::ArrayKernelsExt; +use crate::scalar_fn::ScalarFnVTable; +use crate::scalar_fn::fns::binary::Binary; +use crate::scalar_fn::fns::binary::CompareExecuteAdaptor; pub(super) fn initialize(session: &VortexSession) { let kernels = session.kernels(); diff --git a/vortex-array/src/arrays/runend/mod.rs b/vortex-array/src/arrays/runend/mod.rs new file mode 100644 index 00000000000..a23f9187087 --- /dev/null +++ b/vortex-array/src/arrays/runend/mod.rs @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Copyright the Vortex contributors + +#[cfg(feature = "arbitrary")] +mod arbitrary; +#[cfg(feature = "arbitrary")] +pub use arbitrary::ArbitraryRunEndArray; +pub use array::*; +pub use iter::trimmed_ends_iter; + +mod array; +pub mod compress; +pub(crate) mod compute; +pub mod decompress_bool; +mod iter; +mod kernel; +pub mod ops; +mod probe; +mod rules; +#[cfg(test)] +#[cfg(not(codspeed))] +mod trace_tests; + +#[doc(hidden)] +pub mod _benchmarking { + pub use compute::filter::filter_run_end_primitive; + pub use compute::take::take_indices_unchecked; + + use super::*; +} + +use vortex_session::VortexSession; + +pub(crate) fn initialize(session: &VortexSession) { + kernel::initialize(session); +} + +#[cfg(test)] +mod tests { + use std::sync::LazyLock; + + use prost::Message; + use vortex_session::VortexSession; + + use crate::arrays::runend::RunEndMetadata; + use crate::dtype::PType; + use crate::test_harness::check_metadata; + + pub static SESSION: LazyLock = LazyLock::new(crate::array_session); + + #[cfg_attr(miri, ignore)] + #[test] + fn test_runend_metadata() { + check_metadata( + "runend.metadata", + &RunEndMetadata { + ends_ptype: PType::U64 as i32, + num_runs: u64::MAX, + offset: u64::MAX, + } + .encode_to_vec(), + ); + } +} diff --git a/encodings/runend/src/ops.rs b/vortex-array/src/arrays/runend/ops.rs similarity index 87% rename from encodings/runend/src/ops.rs rename to vortex-array/src/arrays/runend/ops.rs index 71761ec911d..35a1ce7961c 100644 --- a/encodings/runend/src/ops.rs +++ b/vortex-array/src/arrays/runend/ops.rs @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::ExecutionCtx; -use vortex_array::ProbeState; -use vortex_array::match_each_unsigned_integer_ptype; -use vortex_array::scalar::Scalar; -use vortex_array::search_sorted::SearchResult; -use vortex_array::search_sorted::SearchSorted; -use vortex_array::search_sorted::SearchSortedPrimitiveArray; -use vortex_array::search_sorted::SearchSortedSide; -use vortex_array::vtable::OperationsVTable; use vortex_error::VortexResult; -use crate::RunEnd; +use crate::ArrayRef; +use crate::ArrayView; +use crate::ExecutionCtx; +use crate::ProbeState; +use crate::arrays::runend::RunEnd; +use crate::match_each_unsigned_integer_ptype; +use crate::scalar::Scalar; +use crate::search_sorted::SearchResult; +use crate::search_sorted::SearchSorted; +use crate::search_sorted::SearchSortedPrimitiveArray; +use crate::search_sorted::SearchSortedSide; +use crate::vtable::OperationsVTable; impl OperationsVTable for RunEnd { type ProbeState = (); @@ -24,7 +24,7 @@ impl OperationsVTable for RunEnd { index: usize, ctx: &mut ExecutionCtx, ) -> VortexResult { - crate::probe::scalar_at(state, index, ctx) + super::probe::scalar_at(state, index, ctx) } fn scalar_at( @@ -32,7 +32,7 @@ impl OperationsVTable for RunEnd { index: usize, ctx: &mut ExecutionCtx, ) -> VortexResult { - crate::probe::scalar_at(&mut ProbeState::once(array), index, ctx) + super::probe::scalar_at(&mut ProbeState::once(array), index, ctx) } } @@ -78,24 +78,20 @@ pub fn find_physical_index( mod tests { use std::sync::LazyLock; - use vortex_array::IntoArray; - use vortex_array::VortexSessionExecute; - use vortex_array::aggregate_fn::fns::is_constant::is_constant; - use vortex_array::arrays::PrimitiveArray; - use vortex_array::assert_arrays_eq; - use vortex_array::dtype::DType; - use vortex_array::dtype::Nullability; - use vortex_array::dtype::PType; use vortex_buffer::buffer; use vortex_session::VortexSession; - use crate::RunEnd; - - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - crate::initialize(&session); - session - }); + use crate::IntoArray; + use crate::VortexSessionExecute; + use crate::aggregate_fn::fns::is_constant::is_constant; + use crate::arrays::PrimitiveArray; + use crate::arrays::runend::RunEnd; + use crate::assert_arrays_eq; + use crate::dtype::DType; + use crate::dtype::Nullability; + use crate::dtype::PType; + + static SESSION: LazyLock = LazyLock::new(crate::array_session); #[test] fn slice_array() { diff --git a/encodings/runend/src/probe.rs b/vortex-array/src/arrays/runend/probe.rs similarity index 87% rename from encodings/runend/src/probe.rs rename to vortex-array/src/arrays/runend/probe.rs index abcb3d22e0d..46f91bb4fcd 100644 --- a/encodings/runend/src/probe.rs +++ b/vortex-array/src/arrays/runend/probe.rs @@ -3,15 +3,15 @@ //! RunEnd probes retain their ends and values child probes across lookups. -use vortex_array::ExecutionCtx; -use vortex_array::ProbeState; -use vortex_array::scalar::Scalar; use vortex_error::VortexResult; use vortex_error::vortex_err; -use crate::RunEnd; -use crate::RunEndArrayExt; -use crate::RunEndSlots; +use crate::ExecutionCtx; +use crate::ProbeState; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::RunEndArrayExt; +use crate::arrays::runend::RunEndSlots; +use crate::scalar::Scalar; pub(crate) fn scalar_at( state: &mut ProbeState<'_, RunEnd>, diff --git a/encodings/runend/src/probe/tests.rs b/vortex-array/src/arrays/runend/probe/tests.rs similarity index 83% rename from encodings/runend/src/probe/tests.rs rename to vortex-array/src/arrays/runend/probe/tests.rs index cedfe8af16d..d6af96c3317 100644 --- a/encodings/runend/src/probe/tests.rs +++ b/vortex-array/src/arrays/runend/probe/tests.rs @@ -2,27 +2,27 @@ // SPDX-FileCopyrightText: Copyright the Vortex contributors use rstest::rstest; -use vortex_array::ArrayProbe; -use vortex_array::ArrayRef; -use vortex_array::IntoArray; -use vortex_array::RepeatedArrayProbe; -use vortex_array::VortexSessionExecute; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::arrays::VarBinViewArray; -use vortex_array::assert_arrays_eq; -use vortex_array::builders::builder_with_capacity_in; -use vortex_array::builtins::ArrayBuiltins; -use vortex_array::dtype::DType; -use vortex_array::dtype::Nullability; -use vortex_array::scalar::Scalar; -use vortex_array::scalar_fn::fns::operators::Operator; -use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_buffer::buffer; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::tests::SESSION; +use crate::ArrayProbe; +use crate::ArrayRef; +use crate::IntoArray; +use crate::RepeatedArrayProbe; +use crate::VortexSessionExecute; +use crate::arrays::PrimitiveArray; +use crate::arrays::VarBinViewArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::tests::SESSION; +use crate::assert_arrays_eq; +use crate::builders::builder_with_capacity_in; +use crate::builtins::ArrayBuiltins; +use crate::dtype::DType; +use crate::dtype::Nullability; +use crate::scalar::Scalar; +use crate::scalar_fn::fns::operators::Operator; +use crate::validity::Validity; /// A one-off or retained probe over `array`, the retained one living in `retained`. fn probe_for<'a>( diff --git a/encodings/runend/src/rules.rs b/vortex-array/src/arrays/runend/rules.rs similarity index 79% rename from encodings/runend/src/rules.rs rename to vortex-array/src/arrays/runend/rules.rs index a6f3d6a4ae3..5783f695f81 100644 --- a/encodings/runend/src/rules.rs +++ b/vortex-array/src/arrays/runend/rules.rs @@ -1,25 +1,25 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: Copyright the Vortex contributors -use vortex_array::ArrayRef; -use vortex_array::ArrayView; -use vortex_array::IntoArray; -use vortex_array::arrays::Constant; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::ScalarFnArray; -use vortex_array::arrays::scalar_fn::AnyScalarFn; -use vortex_array::arrays::scalar_fn::ScalarFn; -use vortex_array::arrays::scalar_fn::ScalarFnArrayExt; -use vortex_array::dtype::DType; -use vortex_array::optimizer::rules::ArrayParentReduceRule; -use vortex_array::optimizer::rules::ParentRuleSet; -use vortex_array::scalar_fn::fns::cast::CastReduceAdaptor; -use vortex_array::scalar_fn::fns::fill_null::FillNullReduceAdaptor; use vortex_error::VortexResult; -use crate::RunEnd; -use crate::array::RunEndArrayExt; -use crate::array::RunEndArraySlotsExt; +use crate::ArrayRef; +use crate::ArrayView; +use crate::IntoArray; +use crate::arrays::Constant; +use crate::arrays::ConstantArray; +use crate::arrays::ScalarFnArray; +use crate::arrays::runend::RunEnd; +use crate::arrays::runend::array::RunEndArrayExt; +use crate::arrays::runend::array::RunEndArraySlotsExt; +use crate::arrays::scalar_fn::AnyScalarFn; +use crate::arrays::scalar_fn::ScalarFn; +use crate::arrays::scalar_fn::ScalarFnArrayExt; +use crate::dtype::DType; +use crate::optimizer::rules::ArrayParentReduceRule; +use crate::optimizer::rules::ParentRuleSet; +use crate::scalar_fn::fns::cast::CastReduceAdaptor; +use crate::scalar_fn::fns::fill_null::FillNullReduceAdaptor; pub(super) const RULES: ParentRuleSet = ParentRuleSet::new(&[ // CastReduceAdaptor must come before RunEndScalarFnRule so that cast operations are executed diff --git a/encodings/runend/src/trace_tests.rs b/vortex-array/src/arrays/runend/trace_tests.rs similarity index 84% rename from encodings/runend/src/trace_tests.rs rename to vortex-array/src/arrays/runend/trace_tests.rs index 302fc9871fd..2b5c57450c5 100644 --- a/encodings/runend/src/trace_tests.rs +++ b/vortex-array/src/arrays/runend/trace_tests.rs @@ -3,34 +3,30 @@ //! Snapshot tests tracing how reductions and executions flow through run-end arrays. -use vortex_array::ArrayRef; -use vortex_array::Canonical; -use vortex_array::ExecutionCtx; -use vortex_array::IntoArray; -use vortex_array::arrays::BoolArray; -use vortex_array::arrays::ConstantArray; -use vortex_array::arrays::DictArray; -use vortex_array::arrays::FilterArray; -use vortex_array::arrays::PrimitiveArray; -use vortex_array::assert_arrays_eq; -use vortex_array::optimizer::ArrayOptimizer; -use vortex_array::scalar::Scalar; -use vortex_array::scalar_fn::fns::binary::Binary; -use vortex_array::scalar_fn::fns::operators::Operator; -use vortex_array::session::ArraySession; -use vortex_array::test_harness::trace::trace_op; use vortex_error::VortexResult; use vortex_mask::Mask; use vortex_session::VortexSession; -use crate::RunEnd; +use crate::ArrayRef; +use crate::Canonical; +use crate::ExecutionCtx; +use crate::IntoArray; +use crate::arrays::BoolArray; +use crate::arrays::ConstantArray; +use crate::arrays::DictArray; +use crate::arrays::FilterArray; +use crate::arrays::PrimitiveArray; +use crate::arrays::runend::RunEnd; +use crate::assert_arrays_eq; +use crate::optimizer::ArrayOptimizer; +use crate::scalar::Scalar; +use crate::scalar_fn::fns::binary::Binary; +use crate::scalar_fn::fns::operators::Operator; +use crate::session::ArraySession; +use crate::test_harness::trace::trace_op; fn execution_ctx() -> ExecutionCtx { - let session = VortexSession::empty().with::(); - // Execute-parent kernels live in the session registry; without registering RunEnd's own - // kernels the traces below would show plain canonicalization instead of the pushdowns. - crate::initialize(&session); - ExecutionCtx::new(session) + ExecutionCtx::new(VortexSession::empty().with::()) } /// Run-end encoding of `[1, 1, 1, 2, 2, 3, 3, 3, 3]`: ends `[3, 5, 9]`, values `[1, 2, 3]`. diff --git a/vortex-array/src/session/mod.rs b/vortex-array/src/session/mod.rs index e9d0d36a55f..fd53caf395a 100644 --- a/vortex-array/src/session/mod.rs +++ b/vortex-array/src/session/mod.rs @@ -32,6 +32,7 @@ use crate::arrays::Masked; use crate::arrays::Null; use crate::arrays::PiecewiseSequence; use crate::arrays::Primitive; +use crate::arrays::RunEnd; use crate::arrays::Struct; use crate::arrays::Union; use crate::arrays::VarBin; @@ -106,6 +107,7 @@ impl Default for ArraySession { this.register(List); this.register(Masked); this.register(PiecewiseSequence); + this.register(RunEnd); this.register(VarBin); this diff --git a/vortex-arrow/Cargo.toml b/vortex-arrow/Cargo.toml index 8605b37a3f0..8b820b82c9d 100644 --- a/vortex-arrow/Cargo.toml +++ b/vortex-arrow/Cargo.toml @@ -33,7 +33,6 @@ vortex-array = { workspace = true } vortex-buffer = { workspace = true, features = ["arrow"] } vortex-error = { workspace = true } vortex-mask = { workspace = true } -vortex-runend = { workspace = true } vortex-session = { workspace = true } [dev-dependencies] diff --git a/vortex-arrow/src/executor/run_end.rs b/vortex-arrow/src/executor/run_end.rs index cbe0e0c6f3b..aa947a4961d 100644 --- a/vortex-arrow/src/executor/run_end.rs +++ b/vortex-arrow/src/executor/run_end.rs @@ -16,15 +16,15 @@ use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::arrays::Constant; use vortex_array::arrays::ConstantArray; +use vortex_array::arrays::RunEnd; +use vortex_array::arrays::RunEndArray; +use vortex_array::arrays::runend::RunEndArrayExt; +use vortex_array::arrays::runend::RunEndArraySlotsExt; use vortex_array::matcher::Matcher; use vortex_error::VortexError; use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_err; -use vortex_runend::RunEnd; -use vortex_runend::RunEndArray; -use vortex_runend::RunEndArrayExt; -use vortex_runend::RunEndArraySlotsExt; use crate::ArrowExporter; use crate::executor::execute_arrow_naive; @@ -218,11 +218,7 @@ mod tests { use crate::executor::run_end::ConstantArray; use crate::executor::run_end::RunEnd; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); fn ree_type(ends: DataType, values_dtype: DataType) -> DataType { DataType::RunEndEncoded( diff --git a/vortex-arrow/src/options/tests.rs b/vortex-arrow/src/options/tests.rs index 27594022e5c..ac023f715d5 100644 --- a/vortex-arrow/src/options/tests.rs +++ b/vortex-arrow/src/options/tests.rs @@ -27,6 +27,7 @@ use vortex_array::arrays::DictArray; use vortex_array::arrays::FixedSizeListArray; use vortex_array::arrays::ListArray; use vortex_array::arrays::ListViewArray; +use vortex_array::arrays::RunEnd; use vortex_array::arrays::StructArray; use vortex_array::arrays::VarBinViewArray; use vortex_array::dtype::DType; @@ -34,7 +35,6 @@ use vortex_array::dtype::FieldNames; use vortex_array::validity::Validity; use vortex_buffer::buffer; use vortex_error::VortexResult; -use vortex_runend::RunEnd; use vortex_session::registry::CachedId; use vortex_session::registry::Id; diff --git a/vortex-arrow/src/run_end_import.rs b/vortex-arrow/src/run_end_import.rs index d92c6b6c5a8..630210552b1 100644 --- a/vortex-arrow/src/run_end_import.rs +++ b/vortex-arrow/src/run_end_import.rs @@ -8,13 +8,13 @@ use arrow_buffer::ArrowNativeType; use vortex_array::ArrayRef; use vortex_array::IntoArray; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::RunEnd; use vortex_array::arrays::primitive::PrimitiveArrayExt; use vortex_array::dtype::NativePType; use vortex_array::validity::Validity; use vortex_buffer::Buffer; use vortex_error::VortexResult; use vortex_error::vortex_ensure_eq; -use vortex_runend::RunEnd; /// Build a Vortex run-end array from an Arrow [`RunArray`] and its already-converted `values`. /// @@ -85,6 +85,7 @@ mod tests { use vortex_array::IntoArray as _; use vortex_array::VortexSessionExecute as _; use vortex_array::arrays::PrimitiveArray; + use vortex_array::arrays::RunEnd; use vortex_array::assert_arrays_eq; use vortex_array::dtype::DType; use vortex_array::dtype::NativePType; @@ -92,16 +93,11 @@ mod tests { use vortex_array::dtype::PType; use vortex_buffer::buffer; use vortex_error::VortexResult; - use vortex_runend::RunEnd; use vortex_session::VortexSession; use crate::ArrowSessionExt; - static SESSION: LazyLock = LazyLock::new(|| { - let session = vortex_array::array_session(); - vortex_runend::initialize(&session); - session - }); + static SESSION: LazyLock = LazyLock::new(vortex_array::array_session); /// Decode through the session import path, which is what production callers use. fn decode_run_array( diff --git a/vortex-btrblocks/Cargo.toml b/vortex-btrblocks/Cargo.toml index 19cb3c488a7..176e969eff3 100644 --- a/vortex-btrblocks/Cargo.toml +++ b/vortex-btrblocks/Cargo.toml @@ -30,7 +30,6 @@ vortex-fastlanes = { workspace = true } vortex-fsst = { workspace = true } vortex-onpair = { workspace = true } vortex-pco = { workspace = true, optional = true } -vortex-runend = { workspace = true } vortex-sequence = { workspace = true } vortex-session = { workspace = true } vortex-sparse = { workspace = true } diff --git a/vortex-btrblocks/src/schemes/integer/runend.rs b/vortex-btrblocks/src/schemes/integer/runend.rs index 6a97f7ec37d..da388131dab 100644 --- a/vortex-btrblocks/src/schemes/integer/runend.rs +++ b/vortex-btrblocks/src/schemes/integer/runend.rs @@ -10,6 +10,8 @@ use vortex_array::ExecutionCtx; use vortex_array::IntoArray; use vortex_array::VTable; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::RunEnd; +use vortex_array::arrays::runend::compress::runend_encode; use vortex_compressor::builtins::BinaryDictScheme; use vortex_compressor::builtins::FloatDictScheme; use vortex_compressor::builtins::IntDictScheme; @@ -21,8 +23,6 @@ use vortex_compressor::scheme::DeferredEstimate; use vortex_compressor::scheme::DescendantExclusion; use vortex_compressor::scheme::EstimateVerdict; use vortex_error::VortexResult; -use vortex_runend::RunEnd; -use vortex_runend::compress::runend_encode; use super::IntRLEScheme; use super::SparseScheme; diff --git a/vortex-btrblocks/tests/golden.rs b/vortex-btrblocks/tests/golden.rs index 93b936d214e..4704cd80581 100644 --- a/vortex-btrblocks/tests/golden.rs +++ b/vortex-btrblocks/tests/golden.rs @@ -448,7 +448,6 @@ fn edition_session(editions: &[EditionId]) -> VortexResult { vortex_fastlanes::initialize(&session); vortex_fsst::initialize(&session); vortex_onpair::initialize(&session); - vortex_runend::initialize(&session); vortex_sequence::initialize(&session); vortex_sparse::initialize(&session); vortex_zigzag::initialize(&session); diff --git a/vortex-duckdb/Cargo.toml b/vortex-duckdb/Cargo.toml index 38a9799a41b..f28800ad55c 100644 --- a/vortex-duckdb/Cargo.toml +++ b/vortex-duckdb/Cargo.toml @@ -58,7 +58,6 @@ mimalloc = { workspace = true } rstest = { workspace = true } tempfile = { workspace = true } vortex-array = { workspace = true, features = ["_test-harness"] } -vortex-runend = { workspace = true } vortex-sequence = { workspace = true } wkb = { workspace = true } diff --git a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs index ec9ab9860a2..e4f37ab4a07 100644 --- a/vortex-duckdb/src/e2e_test/vortex_scan_test.rs +++ b/vortex-duckdb/src/e2e_test/vortex_scan_test.rs @@ -43,10 +43,10 @@ use vortex::layout::layouts::flat::writer::FlatLayoutStrategy; use vortex::scalar::PValue; use vortex::scalar::Scalar; use vortex_array::arrays::ExtensionArray; +use vortex_array::arrays::RunEnd; use vortex_array::arrays::varbin::builder::VarBinBuilder; use vortex_array::dtype::DType; use vortex_array::dtype::extension::ExtDType; -use vortex_runend::RunEnd; use vortex_sequence::Sequence; use vortex_spatial::extension::SpatialMetadata; use vortex_spatial::extension::WellKnownBinary; diff --git a/vortex-duckdb/src/exporter/list_view.rs b/vortex-duckdb/src/exporter/list_view.rs index 8bf6d8f759b..8ac5a3d4c2e 100644 --- a/vortex-duckdb/src/exporter/list_view.rs +++ b/vortex-duckdb/src/exporter/list_view.rs @@ -196,11 +196,11 @@ impl ColumnExporter for ListViewExporter mod tests { use vortex::array::IntoArray as _; use vortex::array::VortexSessionExecute; + use vortex::array::arrays::RunEnd; use vortex::array::arrays::VarBinArray; use vortex::array::validity::Validity; use vortex::buffer::Buffer; use vortex::buffer::buffer; - use vortex_runend::RunEnd; use super::*; use crate::SESSION; diff --git a/vortex-file/Cargo.toml b/vortex-file/Cargo.toml index b70809e4617..5f639d2b0ba 100644 --- a/vortex-file/Cargo.toml +++ b/vortex-file/Cargo.toml @@ -46,7 +46,6 @@ vortex-mask = { workspace = true } vortex-metrics = { workspace = true } vortex-onpair = { workspace = true } vortex-pco = { workspace = true } -vortex-runend = { workspace = true } vortex-scan = { workspace = true } vortex-sequence = { workspace = true } vortex-session = { workspace = true } diff --git a/vortex-file/src/lib.rs b/vortex-file/src/lib.rs index 707de8bb47e..86fb5cd5737 100644 --- a/vortex-file/src/lib.rs +++ b/vortex-file/src/lib.rs @@ -188,7 +188,6 @@ pub fn register_default_encodings(session: &VortexSession) { vortex_datetime_parts::initialize(session); vortex_decimal_byte_parts::initialize(session); vortex_fastlanes::initialize(session); - vortex_runend::initialize(session); vortex_sequence::initialize(session); vortex_sparse::initialize(session); diff --git a/vortex-layout/Cargo.toml b/vortex-layout/Cargo.toml index 32322fc3c6a..9d93a3e0d1a 100644 --- a/vortex-layout/Cargo.toml +++ b/vortex-layout/Cargo.toml @@ -50,7 +50,6 @@ vortex-error = { workspace = true } vortex-io = { workspace = true } vortex-mask = { workspace = true } vortex-metrics = { workspace = true } -vortex-runend = { workspace = true } vortex-scan = { workspace = true } vortex-sequence = { workspace = true } vortex-session = { workspace = true } diff --git a/vortex-layout/src/layouts/zoned/zone_map.rs b/vortex-layout/src/layouts/zoned/zone_map.rs index dfdb421814b..7755a5b3e93 100644 --- a/vortex-layout/src/layouts/zoned/zone_map.rs +++ b/vortex-layout/src/layouts/zoned/zone_map.rs @@ -21,6 +21,7 @@ use vortex_array::aggregate_fn::fns::bounded_max::BoundedMax; use vortex_array::arrays::BoolArray; use vortex_array::arrays::ConstantArray; use vortex_array::arrays::PrimitiveArray; +use vortex_array::arrays::RunEnd; use vortex_array::arrays::StructArray; use vortex_array::arrays::struct_::StructArrayExt; use vortex_array::dtype::DType; @@ -44,7 +45,6 @@ use vortex_error::VortexResult; use vortex_error::vortex_bail; use vortex_error::vortex_ensure_eq; use vortex_mask::Mask; -use vortex_runend::RunEnd; use vortex_session::VortexSession; use crate::layouts::zoned::schema::aggregate_stats_table_dtype; diff --git a/vortex/Cargo.toml b/vortex/Cargo.toml index fb961a63dab..11bd0935be6 100644 --- a/vortex/Cargo.toml +++ b/vortex/Cargo.toml @@ -40,7 +40,6 @@ vortex-mask = { workspace = true } vortex-metrics = { workspace = true } vortex-parquet-variant = { workspace = true, optional = true } vortex-pco = { workspace = true } -vortex-runend = { workspace = true } vortex-scan = { workspace = true } vortex-sequence = { workspace = true } vortex-session = { workspace = true } diff --git a/vortex/src/lib.rs b/vortex/src/lib.rs index 573e929d036..b43c68005a1 100644 --- a/vortex/src/lib.rs +++ b/vortex/src/lib.rs @@ -285,7 +285,7 @@ pub mod encodings { /// Arrow-compatible run-end encoding. pub mod runend { - pub use vortex_runend::*; + pub use vortex_array::arrays::runend::*; } /// Fixed-step sequence encoding.