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

fix: from_thrift avoid panic when stats in invalid. #4642

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

jackwener
Copy link
Member

Which issue does this PR close?

Closes #3577.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the parquet Changes to the parquet crate label Aug 4, 2023
@jackwener jackwener changed the title refactor: from_thrift avoid panic refactor: from_thrift avoid panic when stats in invalid. Aug 4, 2023
@jackwener jackwener changed the title refactor: from_thrift avoid panic when stats in invalid. fix: from_thrift avoid panic when stats in invalid. Aug 4, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I have not verified this is the only source of panics, but it looks plausible

"Statistics null count is negative ({null_count})"
);

if null_count < 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to use try_into()

@tustvold tustvold added the api-change Changes to the arrow API label Aug 4, 2023
@tustvold tustvold merged commit 273dcc1 into apache:master Aug 4, 2023
18 checks passed
@jackwener jackwener deleted the fix branch August 6, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't Panic on Invalid Parquet Statistics
3 participants