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/29 12:30:06 UTC

[GitHub] [iceberg] openinx opened a new pull request #2392: Flink: Use Namespace in FlinkCatalog.

openinx opened a new pull request #2392:
URL: https://github.com/apache/iceberg/pull/2392


   This address the [comment](https://github.com/apache/iceberg/blob/master/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java#L99) in [FlinkCatalog](https://github.com/apache/iceberg/blob/master/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java)


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


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

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #2392:
URL: https://github.com/apache/iceberg/pull/2392#discussion_r604332662



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalogFactory.java
##########
@@ -120,10 +120,13 @@ public Catalog createCatalog(String name, Map<String, String> properties) {
   protected Catalog createCatalog(String name, Map<String, String> properties, Configuration hadoopConf) {
     CatalogLoader catalogLoader = createCatalogLoader(name, properties, hadoopConf);
     String defaultDatabase = properties.getOrDefault(DEFAULT_DATABASE, "default");
-    String[] baseNamespace = properties.containsKey(BASE_NAMESPACE) ?
-        Splitter.on('.').splitToList(properties.get(BASE_NAMESPACE)).toArray(new String[0]) :
-        new String[0];
     boolean cacheEnabled = Boolean.parseBoolean(properties.getOrDefault(CACHE_ENABLED, "true"));
+
+    Namespace baseNamespace = Namespace.empty();
+    if (properties.containsKey(BASE_NAMESPACE)) {
+      baseNamespace = Namespace.of(properties.get(BASE_NAMESPACE).split("\\."));
+    }

Review comment:
       Why move this below `cacheEnabled`? That seems like it would cause unnecessary git conflicts.




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


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

Posted by GitBox <gi...@apache.org>.
openinx commented on pull request #2392:
URL: https://github.com/apache/iceberg/pull/2392#issuecomment-810886602


   Got this merged,  thanks @rdblue for reviewing.


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


[GitHub] [iceberg] openinx merged pull request #2392: Flink: Use Namespace in FlinkCatalog.

Posted by GitBox <gi...@apache.org>.
openinx merged pull request #2392:
URL: https://github.com/apache/iceberg/pull/2392


   


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


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

Posted by GitBox <gi...@apache.org>.
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