rdblue commented on a change in pull request #2392:
URL: https://github.com/apache/iceberg/pull/2392#discussion_r604331805



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java
##########
@@ -141,10 +139,10 @@ public Catalog catalog() {
   }
 
   private Namespace toNamespace(String database) {
-    String[] namespace = new String[baseNamespace.length + 1];
-    System.arraycopy(baseNamespace, 0, namespace, 0, baseNamespace.length);
-    namespace[baseNamespace.length] = database;
-    return Namespace.of(namespace);
+    List<String> namespaces = 
Lists.newArrayListWithExpectedSize(baseNamespace.levels().length + 1);
+    Collections.addAll(namespaces, baseNamespace.levels());
+    Collections.addAll(namespaces, database);

Review comment:
       Do you need to change the logic here to use a `List`? What about 
changing `baseNamespace` references to `baseNamespace.levels()`? That would be 
fewer changes.




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

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