GH-3574: parquet-hadoop: Statistics.toParquetStatistics: always set null_count#3575
Open
mdibaiee wants to merge 1 commit into
Open
GH-3574: parquet-hadoop: Statistics.toParquetStatistics: always set null_count#3575mdibaiee wants to merge 1 commit into
mdibaiee wants to merge 1 commit into
Conversation
wgtmac
reviewed
May 23, 2026
| public static Statistics toParquetStatistics( | ||
| org.apache.parquet.column.statistics.Statistics stats, int truncateLength) { | ||
| Statistics formatStats = new Statistics(); | ||
| formatStats.setNull_count(stats.getNumNulls()); |
Member
There was a problem hiding this comment.
Do we need to preserve the check stats.isEmpty() for this?
83b6461 to
b6d0e5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Missing
null_countstatistics for columns in parquet files can cause issues with downstream consumers of these files. It is not necessary to omit this statistic for columns which are larger than the truncation configuration, since despite the truncation, their nullability can be asserted with confidence. It is reasonable to keep omitting min/max statistics due to the rationale explained in the comment in the code.What changes are included in this PR?
Always add
null_countstatistics for columns in parquet files, unconditional of their size.Are these changes tested?
Yes,
TestParquetMetadataConverter.javahas been updated to reflect these changesAre there any user-facing changes?
I think we can consider the additional
null_countstatistic's appearance as a user-facing changeCloses #3574