rdblue commented on a change in pull request #1875:
URL: https://github.com/apache/iceberg/pull/1875#discussion_r547445085
##########
File path: core/src/main/java/org/apache/iceberg/CatalogUtil.java
##########
@@ -169,6 +175,26 @@ public static Catalog loadCatalog(
return catalog;
}
+ public static Catalog buildIcebergCatalog(String name, Map<String, String>
options, Configuration conf) {
+
+ String catalogImpl = options.get(CatalogProperties.CATALOG_IMPL);
+ if (catalogImpl == null) {
+ String catalogType = options.getOrDefault(ICEBERG_CATALOG_TYPE,
ICEBERG_CATALOG_TYPE_HIVE);
+ switch (catalogType.toLowerCase(Locale.ENGLISH)) {
+ case ICEBERG_CATALOG_TYPE_HIVE:
+ catalogImpl = ICEBERG_CATALOG_HIVE;
+ break;
+ case ICEBERG_CATALOG_TYPE_HADOOP:
+ catalogImpl = ICEBERG_CATALOG_HADOOP;
+ break;
+ default:
+ throw new UnsupportedOperationException("Unknown catalog type: " +
catalogType);
+ }
+ }
+ return CatalogUtil.loadCatalog(catalogImpl, name, options, conf);
+
Review comment:
Looks like this newline should be above the return to separate it from
the control flow.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]