SamWheating commented on code in PR #14955:
URL: https://github.com/apache/iceberg/pull/14955#discussion_r2658610430
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/procedures/PublishChangesProcedure.java:
##########
@@ -97,23 +97,26 @@ public Iterator<Scan> call(InternalRow args) {
return modifyIcebergTable(
tableIdent,
table -> {
- Optional<Snapshot> wapSnapshot =
- Optional.ofNullable(
- Iterables.find(
- table.snapshots(),
- snapshot -> wapId.equals(WapUtil.stagedWapId(snapshot)),
- null));
- if (!wapSnapshot.isPresent()) {
- throw new ValidationException("Cannot apply unknown WAP ID '%s'",
wapId);
+ Iterable<Snapshot> wapSnapshots =
+ Iterables.filter(
+ table.snapshots(), snapshot ->
wapId.equals(WapUtil.stagedWapId(snapshot)));
Review Comment:
This will still fail with a `DuplicateWAPCommitException` during the cherry
pick operation, originating from here:
https://github.com/apache/iceberg/blob/00046005889c66ffc860bae012d7fc560e8f040a/core/src/main/java/org/apache/iceberg/util/WapUtil.java#L42-L60
--
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]