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

   ## Problem
   
   Last slice of #2083 (part of #2062). The metadata tables hang off 
`Table.Inspect`, which isn't part of the core table contract, and moving an 
exported method off `Table` is breaking, so it has to land before v1.
   
   ## Fix
   
   New `table/inspect` package, shaped like `table/maintenance`: free functions 
that take the table, plus options. The full mapping is in the new `releases.md` 
compatibility note.
   
   | Before | After |
   |---|---|
   | `tbl.Inspect(opts...).Snapshots(ctx)` (and the other 15 tables) | 
`inspect.Snapshots(ctx, tbl, opts...)` |
   | `table.WithInspectAllocator(mem)` | `inspect.WithAllocator(mem)` |
   | `table.HistorySchema()` and the other `*Schema` funcs | 
`inspect.HistorySchema()` |
   | `tbl.Inspect().DiffSnapshotFiles(ctx, a, b)` | `tbl.DiffSnapshotFiles(ctx, 
a, b)` |
   | `tbl.Inspect().ValidateSnapshot(ctx, id)` | `tbl.ValidateSnapshot(ctx, 
id)` |
   
   - `DiffSnapshotFiles` and `ValidateSnapshot` stay on `Table`. They read the 
table's metadata, FS factory, manifest sets, deletion-vector keys and embedded 
v1 spec headers directly, and return Go structs rather than Arrow readers, so 
they read as validation rather than inspection. Moving them would mean 
exporting those internals.
   - `ManifestProvider.UniqueManifests` is exported for the `all_*` tables, as 
discussed on #2614. The alternative is deduping over `Manifests()` inside 
inspect, which loses the bounded prefetch of historical manifest lists.
   - The inspect functions copy the table, as the value-receiver 
`Table.Inspect` did, so a `Refresh` on the caller's table can't change a reader 
that is still being consumed.
   - The name-mapping property check moved to `table/internal`, so scans, 
add-files and `PositionDeletes` share one rule.
   
   ## Testing
   
   - The inspect tests moved with the code and now build their tables through 
the public API (`ParseMetadataBytes`, `MetadataBuilderFromBase`, `table.New`) 
instead of setting `table`'s internal metadata fields; the helpers are in 
`table/inspect/helpers_test.go`. Fixtures that `table`'s own tests still use 
stay in `table/metadata_fixtures_test.go`.
   - Test and benchmark names across `table/` are unchanged, plus 
`TestInspectReadsTableAsOfCall`, which fails if the inspector holds the 
caller's pointer.
   - `TestInspectRefsEmpty` now uses a fresh table, since a current snapshot 
with no main ref can't be built through the public API.
   


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