omarsmak commented on a change in pull request #3162:
URL: https://github.com/apache/iceberg/pull/3162#discussion_r712988763
##########
File path: mr/src/test/java/org/apache/iceberg/mr/TestCatalogs.java
##########
@@ -256,6 +256,20 @@ public void testLoadCatalogHive() {
Assertions.assertThat(hiveCatalog.get()).isInstanceOf(HiveCatalog.class);
}
+ @Test
+ public void testLoadCustomCatalogWithHiveCatalogTypeSet() {
+ String catalogName = "barCatalog";
+ conf.set(InputFormatConfig.catalogPropertyConfigKey(catalogName,
CatalogUtil.ICEBERG_CATALOG_TYPE),
+ CatalogUtil.ICEBERG_CATALOG_TYPE_HIVE);
+ conf.set(InputFormatConfig.catalogPropertyConfigKey(catalogName,
CatalogProperties.CATALOG_IMPL),
+ CustomHadoopCatalog.class.getName());
+ conf.set(InputFormatConfig.catalogPropertyConfigKey(catalogName,
CatalogProperties.WAREHOUSE_LOCATION),
+ "/tmp/mylocation");
+ Optional<Catalog> hiveCatalog = Catalogs.loadCatalog(conf, catalogName);
+
Assertions.assertThat(hiveCatalog.get()).isInstanceOf(CustomHadoopCatalog.class);
+ Assert.assertFalse("Catalog type shouldn't be Hive",
Catalogs.hiveCatalog(conf, catalogName));
Review comment:
Good point! I don't think there is a harm to change it to
package-private and `@VisibleForTesting` annotation.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]