-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crateChanges to the parquet crate
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The fact that Paruqet metadata statistics requires checking before access is confusing and error prone, for example #6092
Describe the solution you'd like
Change the API so it doesn't panic if used incorrectly
Describe alternatives you've considered
I propose removing these methods:
- https://docs.rs/parquet/latest/parquet/file/statistics/enum.Statistics.html#method.has_min_max_set
- https://docs.rs/parquet/latest/parquet/file/statistics/struct.ValueStatistics.html#method.has_min_max_set
And changing the corresponding accessors like min() and max() to return Option<&T> rather than &T
Today:
impl Statistics {
...
// panics if `has_min_max_set` is returns false
pub fn min(&self) -> &T
...
}Proposal:
impl Statistics {
...
// Returns None if statistics not set
pub fn min(&self) -> Option<&T>
...
}Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementAny new improvement worthy of a entry in the changelogAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crateChanges to the parquet crate