Search in sources :

Example 1 with HiveCatalog

use of org.apache.iceberg.hive.HiveCatalog in project hive by apache.

the class TestCatalogs method testLoadCatalogHive.

@Test
public void testLoadCatalogHive() {
    String catalogName = "barCatalog";
    conf.set(InputFormatConfig.catalogPropertyConfigKey(catalogName, CatalogUtil.ICEBERG_CATALOG_TYPE), CatalogUtil.ICEBERG_CATALOG_TYPE_HIVE);
    Optional<Catalog> hiveCatalog = Catalogs.loadCatalog(conf, catalogName);
    Assert.assertTrue(hiveCatalog.isPresent());
    Assertions.assertThat(hiveCatalog.get()).isInstanceOf(HiveCatalog.class);
    Properties properties = new Properties();
    properties.put(InputFormatConfig.CATALOG_NAME, catalogName);
    Assert.assertTrue(Catalogs.hiveCatalog(conf, properties));
}
Also used : CatalogProperties(org.apache.iceberg.CatalogProperties) Properties(java.util.Properties) Catalog(org.apache.iceberg.catalog.Catalog) HadoopCatalog(org.apache.iceberg.hadoop.HadoopCatalog) HiveCatalog(org.apache.iceberg.hive.HiveCatalog) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 CatalogProperties (org.apache.iceberg.CatalogProperties)1 Catalog (org.apache.iceberg.catalog.Catalog)1 HadoopCatalog (org.apache.iceberg.hadoop.HadoopCatalog)1 HiveCatalog (org.apache.iceberg.hive.HiveCatalog)1 Test (org.junit.Test)1