Skip to content

Remove Statistics::has_min_max_set and ValueStatistics::has_min_max_set and use Option instead #6093

@alamb

Description

@alamb

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions