Skip to content

Panic in ParquetMetadata::memory_size if no min/max set #6091

@Ma1oneZhang

Description

@Ma1oneZhang

Describe the bug

In the 52.1.0 release of the parquet crate, new APIs were introduced to retrieve the heap size of parquet metadata. However, a potential issue has been identified in the implementation that could lead to unexpected panics. The problem lies in the file 'parquet/src/file/meta/memory.rs', specifically between lines 168-178. In this section, the code invokes the 'min' function without first verifying the presence of a value in an Option type. This lack of validation before unwrapping could result in a panic if the Option is None.

To Reproduce

Construct a ValueStatistics without min/max value, and invoke the heapsize function.

Expected behavior

return current heap_size

Additional context
NONE

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugparquetChanges to the parquet crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions