Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Ma1oneZhang opened this issue Jul 19, 2024 · 1 comment · Fixed by #6092
Closed

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

Ma1oneZhang opened this issue Jul 19, 2024 · 1 comment · Fixed by #6092
Labels
bug parquet Changes to the parquet crate

Comments

@Ma1oneZhang
Copy link

Ma1oneZhang commented Jul 19, 2024

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

@Ma1oneZhang
Copy link
Author

@alamb Please check the issue

@alamb alamb added the parquet Changes to the parquet crate label Jul 19, 2024
@alamb alamb changed the title Invoke min/max function before check min/max value exists leads to program panic Panic in ParquetMetadata::memory_size if no min/max set Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug parquet Changes to the parquet crate
Projects
None yet
2 participants