Kurtiscwright commented on code in PR #16975:
URL: https://github.com/apache/iceberg/pull/16975#discussion_r3540229803


##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -320,10 +322,16 @@ private void commitReplaceTransaction(boolean orCreate) {
                   }
                 }
 
-                // because this is a replace table, it will always completely 
replace the table
-                // metadata. even if it was just updated.
+                // If the table changed while this transaction was open 
(usually a concurrent
+                // commit), rebuild the replacement on the latest metadata so 
that commit's changes
+                // are not silently dropped. If the latest metadata is null 
the table no longer
+                // exists, so there is nothing to rebuild on and the staged 
replacement is committed
+                // as a new table.
                 if (base != underlyingOps.current()) {
                   this.base = underlyingOps.current(); // just refreshed
+                  if (base != null) {
+                    rebaseReplaceOnto(base);
+                  }
                 }
 

Review Comment:
   To keep in line with the simple-transaction path this has been added in the 
latest commit.



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