mxm commented on code in PR #18517:
URL: https://github.com/apache/iceberg/pull/18517#discussion_r4334919312


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableMetadataCache.java:
##########
@@ -252,6 +256,25 @@ public void invalidate(TableIdentifier identifier) {
     tableCache.remove(identifier);
   }
 
+  /**
+   * Orders the schemas with the current schema first, followed by the rest 
from newest to oldest.
+   * The current schema is not necessarily the one with the highest id, for 
example after a
+   * rollback.
+   */
+  static Map<Integer, Schema> orderSchemas(Map<Integer, Schema> tableSchemas, 
int currentSchemaId) {
+    Map<Integer, Schema> ordered = Maps.newLinkedHashMap();

Review Comment:
   ```suggestion
       Map<Integer, Schema> ordered = 
Maps.newLinkedHashMapWithExpectedSize(tableSchemas.size());
   ```



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