stevenzwu opened a new pull request, #17523: URL: https://github.com/apache/iceberg/pull/17523
Stacked on [#17545](https://github.com/apache/iceberg/pull/17545) (`FileWithKeyId`). Add `Snapshot.rootLocation()` as the version-agnostic accessor for the file a snapshot points at, so later v4 work can address a root manifest through the same accessor that v3 uses for a manifest list. The default returns `manifestListLocation()`, which is now deprecated, and internal callers across core, Spark, and Flink are migrated to the new accessor. `ReachableFileUtil.manifestListLocations()` is likewise replaced by `rootLocations()`. The file itself needs no new type: `FileWithKeyId` already carries the location and encryption key ID for files whose key metadata lives in `TableMetadata.encryptionKeys`, and a v4 root manifest is such a file. Evolve the `SnapshotsTable` metadata schema to expose the location under a version-agnostic name: add an optional `snapshot_file` column (field ID 9) populated for every snapshot. Whether the row also populates `manifest_list` is dispatched per-snapshot via a new default `Snapshot#formatVersion()`. Core compares that against package-private `TableMetadata.UNREPORTED_FORMAT_VERSION` so v3-produced snapshots on a v3→v4 upgraded table keep reporting `manifest_list` correctly. ### Alternative considered: a separate `Snapshot#rootManifestLocation()` A more literal encoding would keep `manifestListLocation()` for v3 and add a sibling `rootManifestLocation()` for v4+. That was rejected because every caller that just wants "where is this snapshot's top-level file" would have to branch on format version. `rootLocation()` collapses that decision into the interface — v3 snapshots return their manifest list, v4+ snapshots return their root manifest, and callers stop caring about the difference. The manifest list (v3) and the root manifest (v4+) play the same structural role: they are the one file the snapshot addresses directly, and everything else is reached transitively. --- **AI Disclosure** - Model: Cursor Grok 4.6 - Platform/Tool: Cursor - Human Oversight: fully reviewed - Prompt Summary: Rebase PR 17523 onto Gabor's FileWithKeyId PR 17545, drop the extra SnapshotFile type, rename snapshotFileLocation to rootLocation, and move the unreported format-version sentinel into core. -- 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]
