-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: split computations of stats for VarBin & VarBinView (#1457)
... instead of computing all stats always (which is very expensive for strings)
- Loading branch information
1 parent
96a0604
commit 1bf69f7
Showing
7 changed files
with
144 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
use vortex_error::VortexResult; | ||
|
||
use crate::accessor::ArrayAccessor; | ||
use crate::array::varbin::compute_stats; | ||
use crate::array::varbin::compute_varbin_statistics; | ||
use crate::array::varbinview::VarBinViewArray; | ||
use crate::array::VarBinViewEncoding; | ||
use crate::nbytes::ArrayNBytes; | ||
use crate::stats::{Stat, StatisticsVTable, StatsSet}; | ||
use crate::{ArrayDType, ArrayLen}; | ||
|
||
impl StatisticsVTable<VarBinViewArray> for VarBinViewEncoding { | ||
fn compute_statistics(&self, array: &VarBinViewArray, stat: Stat) -> VortexResult<StatsSet> { | ||
if stat == Stat::UncompressedSizeInBytes { | ||
return Ok(StatsSet::of(stat, array.nbytes())); | ||
} | ||
|
||
if array.is_empty() { | ||
return Ok(StatsSet::default()); | ||
} | ||
|
||
array.with_iterator(|iter| compute_stats(iter, array.dtype())) | ||
compute_varbin_statistics(array, stat) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters