From 08807adafcc46a100752567d6d663e1b7bb9184f Mon Sep 17 00:00:00 2001 From: Josh Casale Date: Wed, 24 Apr 2024 15:31:10 +0100 Subject: [PATCH] nit --- vortex-zigzag/src/compress.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vortex-zigzag/src/compress.rs b/vortex-zigzag/src/compress.rs index 5852ee1761..12ced08ec0 100644 --- a/vortex-zigzag/src/compress.rs +++ b/vortex-zigzag/src/compress.rs @@ -3,7 +3,7 @@ use vortex::compress::{CompressConfig, CompressCtx, EncodingCompression}; use vortex::ptype::{NativePType, PType}; use vortex::stats::{ArrayStatistics, Stat}; use vortex::validity::Validity; -use vortex::{Array, ArrayDef, AsArray, IntoArray, OwnedArray, ToStatic}; +use vortex::{Array, ArrayDef, AsArray, IntoArray, OwnedArray}; use vortex_alloc::{AlignedVec, ALIGNED_ALLOCATOR}; use vortex_error::VortexResult; use zigzag::ZigZag as ExternalZigZag; @@ -28,7 +28,7 @@ impl EncodingCompression for ZigZagEncoding { // TODO(ngates): also check that Stat::Max is less than half the max value of the type parray .statistics() - .compute_as::(Stat::Min) + .compute_as_cast::(Stat::Min) .filter(|&min| min < 0) .map(|_| self as &dyn EncodingCompression) } @@ -41,10 +41,6 @@ impl EncodingCompression for ZigZagEncoding { ctx: CompressCtx, ) -> VortexResult { let zigzag_like = like.map(|like_arr| like_arr.as_array_ref()); - - if array.encoding().id() == ZigZag::ID { - return Ok(array.clone().to_static()); - } let encoded = if array.encoding().id() == ZigZag::ID { zigzag_encode(&array.as_primitive())? } else { @@ -120,4 +116,4 @@ where } else { PrimitiveArray::from(encoded.to_vec()) } -} +} \ No newline at end of file