riverandeye opened a new pull request, #2825:
URL: https://github.com/apache/iceberg-go/pull/2825

   Fixes #2824
   
   Follow-up to #2779. When the rewrite of a file preserves row lineage (v3), 
the check for rows to drop read every column of the file with no row-group 
pruning. A file that held a matching row was then read again in full by the 
rewrite.
   
   One data file of 29 MB holds 200,000 rows in 10 row groups. The table shows 
the bytes read from data files by a copy-on-write `Delete` of `id = X` on v3.
   
   | | main | this PR |
   |---|---|---|
   | no row matches | 29.1 MB | 30 KB |
   | one row matches | 58.1 MB | 29.1 MB |
   
   v2 already reads 30 KB and 29.1 MB.
   
   ### Change
   
   - Project only the columns the filter references, the same projection the v2 
check uses.
     - The survivor filter is prepared against that projection and applied 
after the scan, as the rewrite does.
     - The scanner still applies type promotion and initial defaults before the 
filter.
   - Prune row groups with the negated survivor filter, which selects the rows 
the rewrite drops.
     - A pruned row group has no row to drop, so the answer cannot change.
     - The rewrite's own `rowGroupFilter` would be wrong here. It keeps 
survivors, so it skips row groups where every row matches, and such a file 
would look unmatched.
   - Answer without reading when the negated filter binds to `AlwaysTrue` or 
`AlwaysFalse`, on v2 and v3. The projection is empty in that case.
   - `PruneColumns` returns a schema without its lazy indexes, so the 
projection is rebuilt with `NewSchemaWithIdentifiers` before the filter binds 
to it.
   
   ### Tests
   
   - `TestCoWRewriteChecksRowsLikeTheRewrite`: new cases the check must still 
rewrite.
     - matching rows fill a whole row group (v2, v3),
     - a float promoted to double matches in one row group only,
     - an equality delete on a column the filter does not reference (v3).
   - `TestCoWRewriteKeepsFilesWithoutMatchingRows`: new cases the check must 
keep.
     - an equality delete on v3,
     - a value inside one row group's bounds but missing (v2, v3).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to