anoopj opened a new pull request, #18852: URL: https://github.com/apache/iceberg/pull/18852
Expose typed snapshot file changes for validation and changelog consumers. Stacked on https://github.com/apache/iceberg/pull/18816. ## Test plan | Test | Purpose | |------|---------| | **1. Root and leaf layouts** | | | `rootWithOnlyDataFiles` | Returns additions and removals stored directly in the root; excludes an unchanged entry. | | `rootWithOnlyLeafManifests` | Combines changes from two ADDED leaf references. Includes a deleted-only leaf with zero live-file counts, guarding against accidental live-file pruning. | | `rootWithMixedDataAndLeafManifests` | Returns all changes from the root and multiple leaves without dropping either source. | | **2. Change traversal** | | | `modifiedLeafUsesModificationSnapshot` | Follows a MODIFIED leaf using its modification snapshot and returns the current removal. | | `modifiedAndReplacedVersionsAcrossLeaves` | Preserves both versions of the same data path, with distinct deletion vectors, in the modified and replaced views. | | `deletedAndReplacedLeafReferencesAreNotOpened` | Skips DELETED and REPLACED leaf references without opening their files. | | **3. Reader configuration** | | | `filterForwardedToRootAndLeafReaders` | Returns matching changes and excludes nonmatching changes at both levels. | | `filterHonorsCaseSensitivity` | Rejects a differently cased field name by default; resolves it in both readers when case sensitivity is disabled. | | `projectStatsForwardedToRootAndLeafReaders` | Retains requested stats and omits unrequested stats for root and leaf data files. | | `tableLocationForwardedToRootAndLeafReaders` | Resolves relative manifest, data-file, and deletion-vector locations using the configured table location. | | **4. Deferred reads and resource ownership** | | | `planningOpensOnlyRoot` | Planning opens and closes the root while leaving leaf readers unopened until a result accessor is called. | | `firstViewAccessClosesManifestReaders` | The first accessor loads the changes and closes every opened reader before returning. Repeated access opens no additional readers. | | **5. Unsupported inputs** | | | `deleteManifestInRootUnsupported` | Rejects a legacy delete-manifest reference with an error identifying its location. | | `standaloneDeleteFileInRootUnsupported` | Rejects POSITION_DELETES and EQUALITY_DELETES entries in the root, identifying their content type and location. | | **6. Snapshot file-change views** | | | `dataChangesAreGroupedByStatus` | Groups four distinct ADDED, DELETED, MODIFIED, and REPLACED files into their corresponding change collections. | | `removedVersionsRetainStats` | Preserves projected stats on removed and replaced data-file versions for later validation. | | `colocatedDVsAreNotStandaloneDeleteFiles` | Retains a data file's deletion-vector descriptor without reporting standalone delete-file additions or removals. | | **7. Repeatability and failures** | | | `changesAreLoadedOnce` | Any of the six accessors can trigger loading. The input is traversed and closed once; subsequent accesses reuse the results. | | `failedLoadsAreNotRetried` | An iteration failure closes the input and is rethrown by subsequent accessors without another read or close. | | `failedClosesAreNotRetried` | A close failure prevents publishing results; subsequent accessors rethrow without rereading or reclosing the input. | -- 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]
