diff --git a/benchmarks/datafusion-bench/Cargo.toml b/benchmarks/datafusion-bench/Cargo.toml index d0015dd2995..e0f88c9adfa 100644 --- a/benchmarks/datafusion-bench/Cargo.toml +++ b/benchmarks/datafusion-bench/Cargo.toml @@ -46,7 +46,7 @@ custom-labels = { workspace = true } [features] cuda = ["dep:vortex-cuda"] -unstable_encodings = ["vortex/unstable_encodings"] +unstable_encodings = ["vortex/unstable_encodings", "vortex-bench/unstable_encodings"] [lints] workspace = true diff --git a/benchmarks/duckdb-bench/Cargo.toml b/benchmarks/duckdb-bench/Cargo.toml index b70375cf963..b2de451e893 100644 --- a/benchmarks/duckdb-bench/Cargo.toml +++ b/benchmarks/duckdb-bench/Cargo.toml @@ -27,7 +27,7 @@ vortex-duckdb = { workspace = true } [features] cuda = ["dep:vortex-cuda"] -unstable_encodings = ["vortex/unstable_encodings"] +unstable_encodings = ["vortex/unstable_encodings", "vortex-bench/unstable_encodings"] [lints] workspace = true diff --git a/vortex-bench/src/lib.rs b/vortex-bench/src/lib.rs index 8981b4859cf..c91660a1143 100644 --- a/vortex-bench/src/lib.rs +++ b/vortex-bench/src/lib.rs @@ -235,11 +235,17 @@ pub enum CompactionStrategy { impl CompactionStrategy { pub fn apply_options(&self, options: VortexWriteOptions) -> VortexWriteOptions { match self { - CompactionStrategy::Compact => options.with_strategy( - WriteStrategyBuilder::default() - .with_btrblocks_builder(BtrBlocksCompressorBuilder::default().with_compact()) - .build(), - ), + CompactionStrategy::Compact => { + #[cfg(feature = "unstable_encodings")] + let btrblocks = BtrBlocksCompressorBuilder::default().with_compact_buffers(); + #[cfg(not(feature = "unstable_encodings"))] + let btrblocks = BtrBlocksCompressorBuilder::default().with_compact(); + options.with_strategy( + WriteStrategyBuilder::default() + .with_btrblocks_builder(btrblocks) + .build(), + ) + } CompactionStrategy::Default => options, } } diff --git a/vortex-btrblocks/src/builder.rs b/vortex-btrblocks/src/builder.rs index 6489f2d4e52..c604a76069b 100644 --- a/vortex-btrblocks/src/builder.rs +++ b/vortex-btrblocks/src/builder.rs @@ -161,6 +161,21 @@ impl BtrBlocksCompressorBuilder { builder } + /// Same as with_compact() but ZstdBuffers is used instead of Zstd + #[cfg(all(feature = "zstd", feature = "unstable_encodings"))] + pub fn with_compact_buffers(self) -> Self { + let builder = self + .with_new_scheme(&string::ZstdBuffersScheme) + .with_new_scheme(&binary::ZstdBuffersScheme); + + #[cfg(feature = "pco")] + let builder = builder + .with_new_scheme(&integer::PcoScheme) + .with_new_scheme(&float::PcoScheme); + + builder + } + /// Excludes schemes without CUDA kernel support and adds Zstd for string and binary compression. /// /// With the `unstable_encodings` feature, buffer-level Zstd compression is used which