fix(table): guard DV filtering against stale row counts - #1624
Open
fallintoplace wants to merge 3 commits into
Open
fix(table): guard DV filtering against stale row counts#1624fallintoplace wants to merge 3 commits into
fallintoplace wants to merge 3 commits into
Conversation
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.
Summary
Prevent deletion-vector filtering from panicking when a data file emits more rows than its manifest
record_count.Problem
The contiguous fast path builds a keep mask sized from
DataFile.Count()and slices it using the rows emitted by each Arrow batch. If the manifest count is stale or otherwise smaller than the physical file, the batch end falls outside the mask andarray.NewSlicepanics.The row-group-pruned path already handles this mismatch by preserving positions beyond the mask. The contiguous path should behave the same way.
Fix
Keep the existing zero-copy mask slice while a batch is within the declared row count. If a batch crosses that boundary, build a bounded mask for that batch and keep rows whose positions are beyond the declared count. Once a batch is entirely beyond the mask, pass it through without allocating an all-true filter. In-range deletion-vector positions are still applied normally.
Tests
Added coverage across three batches: one within the manifest count, one crossing it, and one entirely beyond it. The test verifies in-range deletes while preserving rows beyond the declared count.