rdblue 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_r360486027
##########
File path: hive/src/main/java/org/apache/iceberg/hive/HiveCatalog.java
##########
@@ -188,6 +295,43 @@ 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, Map<String, String>
meta) {
+ String warehouseLocation = conf.get("hive.metastore.warehouse.dir");
+ Preconditions.checkNotNull(warehouseLocation,
+ "Warehouse location is not set: hive.metastore.warehouse.dir=null");
Review comment:
This check is only necessary if `location` is not set in the metadata.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]