fix PruneManifests::row_counts to use total live rows#21
Merged
Conversation
…d_rows_count added_rows_count counts only ADDED-status files in the current snapshot. Manifests carrying EXISTING rows (e.g. after compaction) have added_rows_count=0, causing DataFusion's IS NOT NULL pruning (null_count != row_count) to evaluate 0 != 0 = false and incorrectly prune manifests that contain live data. Use added + existing - deleted to get the actual live row count; fall back to None (unknown) when any of the three optional fields is absent. Fixes #359 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
laverem
approved these changes
Jun 17, 2026
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.
added_rows_countcounts only ADDED-status files in the current snapshot. Manifests carrying EXISTING rows (e.g. after compaction) haveadded_rows_count = 0, causing DataFusion's IS NOT NULL pruning (null_count != row_count) to evaluate0 != 0 = falseand incorrectly prune manifests that contain live data — silently returning empty results.Uses
added + existing - deletedfor the actual live row count; falls back toNone(unknown, safe) when any of the three optional fields is absent.Fixes JanKaul#359