rdblue commented on a change in pull request #1394:
URL: https://github.com/apache/iceberg/pull/1394#discussion_r479425205
##########
File path: mr/src/main/java/org/apache/iceberg/mr/Catalogs.java
##########
@@ -83,28 +87,33 @@ private static Table loadTable(Configuration conf, String
tableIdentifier, Strin
.impl(catalogLoaderClass)
.build()
.newInstance();
- return Optional.of(loader.load(conf));
+ Catalog catalog = loader.load(conf);
+ LOG.info("Loaded catalog {} using {}", catalog, catalogLoaderClass);
+ return Optional.of(catalog);
}
String catalogName = conf.get(InputFormatConfig.CATALOG);
if (catalogName != null) {
+ Catalog catalog;
switch (catalogName.toLowerCase()) {
case HADOOP:
String warehouseLocation =
conf.get(InputFormatConfig.HADOOP_CATALOG_WAREHOUSE_LOCATION);
- if (warehouseLocation != null) {
- return Optional.of(new HadoopCatalog(conf, warehouseLocation));
- }
-
- return Optional.of(new HadoopCatalog(conf));
+ catalog = (warehouseLocation != null) ? new HadoopCatalog(conf,
warehouseLocation) : new HadoopCatalog(conf);
+ break;
case HIVE:
- return Optional.of(HiveCatalogs.loadCatalog(conf));
+ catalog = HiveCatalogs.loadCatalog(conf);
+ break;
default:
throw new NoSuchNamespaceException("Catalog " + catalogName + " is
not supported.");
}
+
+ LOG.info("Catalog is used: {}", catalog);
Review comment:
How about logging a similar message in the HADOOP and HIVE cases instead
of this?
```
LOG.info("Loaded Hive Metastore catalog {}", catalog);
```
That gives more information about the path the code took.
----------------------------------------------------------------
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]