GH-3574: Preserve null counts when min/max exceed limit - #3819
efegokdemir wants to merge 2 commits into
Conversation
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
divjotarora
left a comment
There was a problem hiding this comment.
Thanks @efegokdemir!
There was a problem hiding this comment.
@efegokdemir My previous comment was not addressed, the current code still sets NaN count stats after the withinLimit check. I suggest we set null + NaN stats unconditionally and guard only min/max by the withinLimit check.
Proposed code:
formatStats.setNull_count(stats.getNumNulls());
if (stats.isNanCountSet()) {
formatStats.setNan_count(stats.getNanCount());
}
if (!withinLimit(stats, truncateLength)) {
return formatStats;
}
Signed-off-by: Efe Gökdemir <gokdemirefe1903@gmail.com>
|
Moved |
Summary
Preserve
null_countwhen a column's min/max statistics exceed the metadata size limit.The size guard is needed for min/max values, but
null_countis a compact independent statistic and remains useful to readers. This keeps the null count available without reintroducing oversized min/max metadata.Changes
null_countbefore applying the min/max size limit.Testing
./mvnw -pl parquet-hadoop -am -DskipITs -Dtest=TestParquetMetadataConverter -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -pl parquet-hadoop -am -DskipTests spotless:checkgit diff --checkAll passed.
Notes
Fixes #3574