RussellSpitzer commented on code in PR #15656:
URL: https://github.com/apache/iceberg/pull/15656#discussion_r2943184855
##########
core/src/main/java/org/apache/iceberg/CherryPickOperation.java:
##########
@@ -218,17 +216,22 @@ private static void validateReplacedPartitions(
parentId == null || isCurrentAncestor(meta, parentId),
"Cannot cherry-pick overwrite, based on non-ancestor of the current
state: %s",
parentId);
- try (CloseableIterable<DataFile> newFiles =
- SnapshotUtil.newFilesBetween(
- parentId, meta.currentSnapshot().snapshotId(), meta::snapshot,
io)) {
- for (DataFile newFile : newFiles) {
+ List<Snapshot> snapshots =
+ Lists.newArrayList(
+ SnapshotUtil.ancestorsBetween(
+ meta.currentSnapshot().snapshotId(), parentId,
meta::snapshot));
+ if (!snapshots.isEmpty()) {
+ SnapshotChanges changes =
+ SnapshotChanges.builderFor(io, meta.specsById())
Review Comment:
This is another package private constructor that we need just for this
caller. We now have two callers (CherryPickOperation and MicroBatches) which
have their own private constructors. I don't like this but we can probably
clean up in a follow up.
--
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]