-
Notifications
You must be signed in to change notification settings - Fork 4.2k
GH-50692: [C++][Parquet] treat negative null_count and distinct_count values as missing #50694
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -306,10 +306,10 @@ static inline EncodedStatistics FromThrift(const format::Statistics& stats, | |
| out.set_min(stats.min); | ||
| } | ||
| } | ||
| if (stats.__isset.null_count) { | ||
| if (stats.__isset.null_count && stats.null_count >= 0) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This silently changes the public behavior that corrupted values are no longer visible to users from reading a file. I think we have a few options w.r.t. values in the stats and page indexes:
My understanding is that users have to validate these values before consumption anyway. In that case, an unset or corrupted value does not make too much difference. Users may still want to read the file even when there are corrupted stats (or even columns/row groups), e.g. recover corrupted/legacy files. So I think we shouldn't error out on invalid stats. Preserving corrupted values still bring some values like help inspecting the files so here might be the best place to fix this issue? WDYT? @pitrou @mapleFU @emkornfield
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see this was closed, but would just like to say that the situation here is a little different from arrow-rs. It seems arrow-cpp keeps the sign for |
||
| out.set_null_count(stats.null_count); | ||
| } | ||
| if (stats.__isset.distinct_count) { | ||
| if (stats.__isset.distinct_count && stats.distinct_count >= 0) { | ||
| out.set_distinct_count(stats.distinct_count); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we directly use
metadata.statistics?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the values which
metadata.statisticscontains are the negative values. I want to use the values modified inFromThrift.