-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
16 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
29 changes: 29 additions & 0 deletions
29
crates/polars-parquet/src/arrow/read/statistics/binview.rs
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use arrow::array::{MutableArray, MutableBinaryViewArray, ViewType}; | ||
use polars_error::PolarsResult; | ||
|
||
use crate::parquet::statistics::{BinaryStatistics, Statistics as ParquetStatistics}; | ||
|
||
pub(super) fn push<T: ViewType + ?Sized>( | ||
from: Option<&dyn ParquetStatistics>, | ||
min: &mut dyn MutableArray, | ||
max: &mut dyn MutableArray, | ||
) -> PolarsResult<()> { | ||
let min = min | ||
.as_mut_any() | ||
.downcast_mut::<MutableBinaryViewArray<T>>() | ||
.unwrap(); | ||
let max = max | ||
.as_mut_any() | ||
.downcast_mut::<MutableBinaryViewArray<T>>() | ||
.unwrap(); | ||
let from = from.map(|s| s.as_any().downcast_ref::<BinaryStatistics>().unwrap()); | ||
min.push(from.and_then(|s| { | ||
let opt_b = s.min_value.as_deref(); | ||
unsafe { opt_b.map(|b| T::from_bytes_unchecked(b)) } | ||
})); | ||
max.push(from.and_then(|s| { | ||
let opt_b = s.max_value.as_deref(); | ||
unsafe { opt_b.map(|b| T::from_bytes_unchecked(b)) } | ||
})); | ||
Ok(()) | ||
} |
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