Repository navigation
Conversation
edmondop
force-pushed
the
fix-empty-partition-statistics
branch
from
November 22, 2026 14:50
ff25057 to
7b81e40
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.
Which issue does this PR close?
Closes apache#27456.
Rationale for this change
A partitioned Parquet table with one row in
p=1and empty files inp=0andp=7returns1, 0, 7forSELECT count(*), min(p), max(p). The empty files contribute their directory values to the statistics used to answer MIN/MAX. The correct result is1, 1, 1.What changes are included in this PR?
PartitionedFile::with_statisticsnow gives partition columns absent MIN/MAX and zero distinct values when the file has exactly zero rows. It reusesis_known_empty, which distinguishes an exact zero from an estimate. The statistics contract is documented alongside the method and struct.Absent combined extrema can require normal aggregate evaluation rather than answering MIN/MAX from metadata.
What is the testing strategy for this PR?
parquet_statistics.sltcovers empty partitions below and above a nonempty partition, plus an empty selection. The mixed-partition query fails on upstreammainwith1, 0, 7and passes with this fix.bashbecause/bin/bashis absent.Are there any user-facing changes?
MIN/MAX of partition columns no longer includes values from files known to contain zero rows.
Implemented and tested with AI assistance (Codex). This draft is awaiting author review.