You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/01/27 12:55:35 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #6676: Nessie : use default namespace location if exists

nastra commented on code in PR #6676:
URL: https://github.com/apache/iceberg/pull/6676#discussion_r1088930835


##########
core/src/main/java/org/apache/iceberg/BaseMetastoreCatalog.java:
##########
@@ -36,6 +36,8 @@
 public abstract class BaseMetastoreCatalog implements Catalog {
   private static final Logger LOG = LoggerFactory.getLogger(BaseMetastoreCatalog.class);
 
+  protected static final String NAMESPACE_LOCATION_PROPS = "location";

Review Comment:
   why not just keep this in the `NessieCatalog`?



##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieCatalog.java:
##########
@@ -202,7 +202,17 @@ protected TableOperations newTableOps(TableIdentifier tableIdentifier) {
   protected String defaultWarehouseLocation(TableIdentifier table) {
     String location;
     if (table.hasNamespace()) {
-      location = SLASH.join(warehouseLocation, table.namespace().toString(), table.name());
+      String baseLocation;

Review Comment:
   maybe define the base location here directly? `String baseLocation = SLASH.join(warehouseLocation, table.namespace().toString())`.
   
   Then you could use it directly in as the fallback: `loadNamespaceMetadata(table.namespace()).getOrDefault(NAMESPACE_LOCATION_PROPS, baseLocation)`
   



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

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