You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "singhpk234 (via GitHub)" <gi...@apache.org> on 2026/01/07 09:35:35 UTC
Re: [PR] Spark 4.1: Fail publish_changes procedure if there's more than one matching snapshot [iceberg]
singhpk234 commented on code in PR #14955:
URL: https://github.com/apache/iceberg/pull/14955#discussion_r2667703668
##########
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:
Thank you for the pointer @SamWheating do we have coverage for UT for this specific scenario ?
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org