amogh-jahagirdar commented on code in PR #4926:
URL: https://github.com/apache/iceberg/pull/4926#discussion_r938172867


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -150,28 +173,37 @@ public ThisT deleteWith(Consumer<String> deleteCallback) {
    * <p>Child operations can override this to add custom validation.
    *
    * @param currentMetadata current table metadata to validate
+   * @param snapshot ending snapshot on the lineage which is being validated
    */
-  protected void validate(TableMetadata currentMetadata) {}
+  protected void validate(TableMetadata currentMetadata, Snapshot snapshot) {}
 
   /**
    * Apply the update's changes to the base table metadata and return the new 
manifest list.
    *
    * @param metadataToUpdate the base table metadata to apply changes to
+   * @param snapshot
    * @return a manifest list for the new snapshot.
    */
-  protected abstract List<ManifestFile> apply(TableMetadata metadataToUpdate);
+  protected abstract List<ManifestFile> apply(TableMetadata metadataToUpdate, 
Snapshot snapshot);
 
   @Override
   public Snapshot apply() {
     refresh();
-    Long parentSnapshotId =
-        base.currentSnapshot() != null ? base.currentSnapshot().snapshotId() : 
null;
-    long sequenceNumber = base.nextSequenceNumber();
+    Snapshot parentSnapshot = base.currentSnapshot();
+    if (targetBranch != null) {

Review Comment:
   Also considering targetBranch will always be set (we have it default to 
Main, we don't need this check). 



-- 
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]

Reply via email to