From 6fcafe8cd48405e7e8de62ecf58bc4be10431bce Mon Sep 17 00:00:00 2001 From: Andrew Duffy Date: Wed, 24 Jul 2024 14:43:53 -0400 Subject: [PATCH] FoR will compress signed array when min == 0 now (#511) Fixes #509 Previously, FoR would bail out early if it detected that min == 0. However, we still want to FoR encode when the array is signed, so that we get a bitpackable unsigned array out of FoR compression --- vortex-sampling-compressor/src/compressors/for.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vortex-sampling-compressor/src/compressors/for.rs b/vortex-sampling-compressor/src/compressors/for.rs index 1cd73df893..d40a682a91 100644 --- a/vortex-sampling-compressor/src/compressors/for.rs +++ b/vortex-sampling-compressor/src/compressors/for.rs @@ -35,7 +35,7 @@ impl EncodingCompressor for FoRCompressor { let shift = trailing_zeros(array); match_each_integer_ptype!(parray.ptype(), |$P| { let min: $P = parray.statistics().compute_min()?; - if min == 0 && shift == 0 { + if min == 0 && shift == 0 && parray.ptype().is_unsigned_int() { return None; } });