Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcasale committed Apr 24, 2024
1 parent d498916 commit 08807ad
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions vortex-zigzag/src/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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::<i64>(Stat::Min)
.compute_as_cast::<i64>(Stat::Min)
.filter(|&min| min < 0)
.map(|_| self as &dyn EncodingCompression)
}
Expand All @@ -41,10 +41,6 @@ impl EncodingCompression for ZigZagEncoding {
ctx: CompressCtx,
) -> VortexResult<OwnedArray> {
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 {
Expand Down Expand Up @@ -120,4 +116,4 @@ where
} else {
PrimitiveArray::from(encoded.to_vec())
}
}
}

0 comments on commit 08807ad

Please sign in to comment.