Skip to content

Commit 1ba4612

Browse files
authored
Merge pull request #3 from spiceai/peasee-patch-6
fix: Ensure UncompressedSizeInBytes statistic is calculated
2 parents 05284cd + 831435b commit 1ba4612

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

vortex-array/src/compute/take.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,20 @@ fn propagate_take_stats(source: &dyn Array, target: &dyn Array) -> VortexResult<
118118
// Any combination of elements from a constant array is still const
119119
st.set(Stat::IsConstant, Precision::exact(true));
120120
}
121-
let inexact_min_max = [Stat::Min, Stat::Max]
122-
.into_iter()
123-
.filter_map(|stat| {
124-
source
125-
.statistics()
126-
.get(stat)
127-
.map(|v| (stat, v.map(|s| s.into_value()).into_inexact()))
128-
})
129-
.collect::<Vec<_>>();
121+
let inexact_min_max = [
122+
Stat::Min,
123+
Stat::Max,
124+
Stat::UncompressedSizeInBytes,
125+
Stat::IsConstant,
126+
]
127+
.into_iter()
128+
.filter_map(|stat| {
129+
source
130+
.statistics()
131+
.get(stat)
132+
.map(|v| (stat, v.map(|s| s.into_value()).into_inexact()))
133+
})
134+
.collect::<Vec<_>>();
130135
st.combine_sets(
131136
&(unsafe { StatsSet::new_unchecked(inexact_min_max) }).as_typed_ref(source.dtype()),
132137
)

vortex-array/src/stats/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub const PRUNING_STATS: &[Stat] = &[
3838
Stat::Sum,
3939
Stat::NullCount,
4040
Stat::NaNCount,
41+
Stat::UncompressedSizeInBytes,
4142
];
4243

4344
#[derive(

vortex-datafusion/src/persistent/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use vortex::error::{VortexExpect, VortexResult, vortex_err};
3535
use vortex::file::VORTEX_FILE_EXTENSION;
3636
use vortex::scalar::Scalar;
3737
use vortex::session::VortexSession;
38-
use vortex::stats::{Stat, StatsSet};
38+
use vortex::stats::{ArrayStats, Stat, StatsSet};
3939
use vortex::{VortexSessionDefault, stats};
4040

4141
use super::cache::VortexFileCache;

0 commit comments

Comments
 (0)