leangjonathan commented on code in PR #10861:
URL: https://github.com/apache/iceberg/pull/10861#discussion_r1707621872


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1020,8 +1020,12 @@ public Builder upgradeFormatVersion(int 
newFormatVersion) {
         return this;
       }
 
+      // register incremental version changes separately to ensure all upgrade 
requirements are met

Review Comment:
   We are iterating in the loop from `this.formatVersion` to start so we'd need 
to store it in another local var which is unnecessary IMO.
   
   I did find a more concise way to write the loop though and get rid of the 
assignment
   ```
         // register incremental version changes separately to ensure all 
upgrade requirements are met
         do {
           changes.add(new 
MetadataUpdate.UpgradeFormatVersion(++formatVersion));
         } while (formatVersion < newFormatVersion);
   
         this.formatVersion = newFormatVersion;
   ```



##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -1020,8 +1020,12 @@ public Builder upgradeFormatVersion(int 
newFormatVersion) {
         return this;
       }
 
+      // register incremental version changes separately to ensure all upgrade 
requirements are met

Review Comment:
   We are iterating in the loop from `this.formatVersion` to start so we'd need 
to store it in another local var which is unnecessary IMO.
   
   I did find a more concise way to write the loop though and get rid of the 
assignment
   ```
         // register incremental version changes separately to ensure all 
upgrade requirements are met
         do {
           changes.add(new 
MetadataUpdate.UpgradeFormatVersion(++formatVersion));
         } while (formatVersion < newFormatVersion);
   ```



-- 
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-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to