YananLiUCI commented on a change in pull request #688: [ISSUE #672] Add SupportsNamespaces for 'HadoopCatalog' and 'HiveCatalog' URL: https://github.com/apache/incubator-iceberg/pull/688#discussion_r355071280
########## File path: hive/src/main/java/org/apache/iceberg/hive/HiveCatalog.java ########## @@ -188,6 +300,33 @@ protected String defaultWarehouseLocation(TableIdentifier tableIdentifier) { tableIdentifier.name()); } + public Map<String, String> getMetafrpmhiveDb(Database database) { + Map<String, String> nameMap = new HashMap<>(); + + nameMap.put("name", database.getName()); + nameMap.put("location", database.getLocationUri()); + nameMap.put("comment", database.getDescription()); + database.getParameters().forEach(nameMap::put); + + return nameMap; + } + + public Database nameSpaceToHiveDb(Namespace namespace) { + String warehouseLocation = conf.get("hive.metastore.warehouse.dir"); + Preconditions.checkNotNull( + warehouseLocation, + "Warehouse location is not set: hive.metastore.warehouse.dir=null"); + Joiner slash = Joiner.on("/"); Review comment: Why there is no check for empty namespace here? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org