Repository navigation
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 |
|
Thanks for flagging #3688. At the current head, this change emits |
|
@divjotarora Sorry I cannot find any concrete evidence right now. If I remember it correctly, that change may break Iceberg to consume Parquet statistics. Perhaps @kevinjqliu @Fokko could provide more detail. |
|
The issue is described on the devlist: https://lists.apache.org/thread/fx96wnmkbmx7pcz2h89t592ztc8bcrn1 I'm unable to open it ritght now. It had to do with the semantic meaning of |
|
@Fokko Thanks for the link. Unfortunately, it doesn't load for me, just says "Could not load this thread". Seems like this is an issue on the Iceberg side? Is it a general spec issue in Iceberg or localized to a subset of implementations? |
|
The build has been unblocked for me after #3855 (thanks @wgtmac for the quick review). I've published the jar locally using I ran the tests and it passed all the tests on the Iceberg side: I would have to check what the difference is between this one, and the previous PR, but this seems to play nicer with Iceberg 👍 |
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_countandnan_countbefore applying the min/max size limit for non-empty statistics.Testing
git diff --checkpassed.Compatibility note
For oversized, non-empty statistics, this changes the result from no statistics to counts without min/max. This is narrower than the unconditional null-count change reverted in #3688, but it still changes the previous all-or-nothing behavior. That compatibility question is under discussion.
Fixes #3574