fix: ignore exact empty files in ordering analysis - #24648
Open
xudong963 wants to merge 1 commit into
Open
Conversation
xudong963
force-pushed
the
fix/ignore-empty-files-in-ordering
branch
from
August 25, 2026 08:25
fae6594 to
aa07f9d
Compare
xudong963
marked this pull request as draft
August 25, 2026 08:33
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24648 +/- ##
========================================
Coverage 81.44% 81.44%
========================================
Files 1118 1118
Lines 399560 399671 +111
Branches 399560 399671 +111
========================================
+ Hits 325424 325526 +102
- Misses 55137 55142 +5
- Partials 18999 19003 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xudong963
marked this pull request as ready for review
August 25, 2026 09:37
Member
Author
|
CC @asolimando in case you have time to review the stats improvement. |
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?
Rationale for this change
A file with exactly zero rows cannot violate a sort order, but schema-only Parquet files normally have neither
sorting_columnsordering nor column min/max values. Treating those missing values as evidence against the non-empty files can add an unnecessarySortExec; with statistics-based file-group splitting enabled, it can also fail planning withstatistics not found.The Parquet footer row count is already available during listing, so exact empty files can be ignored without additional I/O. Files with absent or inexact row counts remain conservative.
What changes are included in this PR?
num_rows == Precision::Exact(0)when deriving a common file ordering.MinMaxStatisticsand sort-column NULL checks.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes. Scans over ordered Parquet datasets can retain their output ordering when exact empty files are present, avoiding an unnecessary sort, and statistics-based file-group splitting no longer fails on those files. There are no public API changes.