TT1nKer opened a new issue, #2756:
URL: https://github.com/apache/iceberg-go/issues/2756

   ### Feature request
   
   An unfiltered, row-limited local scan can have enough rows in its first data 
manifest even when the snapshot contains an older delete manifest. Today the 
presence of any delete manifest disables the manifest-list shortcut. This 
matters for tables that keep receiving appends after a merge-on-read delete. 
[Current planning 
guard](https://github.com/apache/iceberg-go/blob/81bc3b8a9e78521a084796db3f5e3b1795ef7dff/table/scanner.go#L1926-L1945)
   
   ### Reproduction on iceberg-go main
   
   I used a v2 table with one integer ID column and four commits. The first 
appended IDs 0–15. The second position-deleted ID 0. The next two appended IDs 
16–31 and 32–47 in separate files and manifests. At the final snapshot, the 
data manifests were in sequence order 4, 3, 1, with 16 rows each. The delete 
manifest was from sequence 2.
   
   On commit `81bc3b8`, I counted distinct paths opened through `FileIO.Open` 
and `ReadFile` during `PlanFiles`, using a fresh table handle and 
`WithMaxConcurrency(1)` for each run. Three repetitions gave the same counts. 
Both scans also opened the manifest list once.
   
   | Scan | Data manifests opened | Delete manifests opened | File tasks 
planned | Rows returned by `ReadTasks` |
   | --- | ---: | ---: | ---: | ---: |
   | Unrestricted | 3 | 1 | 3 | 47 |
   | `UseRowLimit(10)` | 3 | 1 | 3 | 10 |
   
   After planning, passing only the first task to the existing `ReadTasks` 
returned the same ten IDs (32–41) in the same order. For a limit of 24, passing 
the first two tasks also matched the ordinary result row for row.
   
   ### Suggested scope
   
   For an unfiltered v2 scan, consider the leading data manifests in their 
existing order. A prefix can satisfy the limit if its known added and existing 
row counts cover the request and the **minimum data sequence number** of each 
included manifest is strictly greater than every delete manifest’s sequence 
number. Using the minimum protects rewritten manifests that contain old data. 
Strict comparison keeps same-commit position deletes on the existing path. 
Unknown counts or sequences, or an insufficient prefix, can also use the 
existing planner. [Iceberg delete applicability 
rules](https://iceberg.apache.org/spec/#scan-planning)
   
   I'd like to contribute the change and regression tests if this scope makes 
sense to the maintainers. OpenAI Codex assisted with constructing the fixture, 
running the comparisons, and drafting this report.
   


-- 
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