You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/03/30 18:21:13 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2392: Flink: Use Namespace in FlinkCatalog.

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:
users@infra.apache.org



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