Search in sources :

Example 11 with IcebergMetastore

use of org.apache.drill.metastore.iceberg.IcebergMetastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testCreationWithComponentPropertiesPrecedence.

@Test
public void testCreationWithComponentPropertiesPrecedence() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()).withValue(String.format(COMPONENTS_COMMON_PROPERTIES_PATTERN, TableProperties.SPLIT_SIZE), ConfigValueFactory.fromAnyRef(10)).withValue(String.format(COMPONENTS_TABLES_PROPERTIES_PATTERN, TableProperties.SPLIT_SIZE), ConfigValueFactory.fromAnyRef(100)));
    Metastore metastore = new IcebergMetastore(config);
    assertEquals(Collections.singletonMap(TableProperties.SPLIT_SIZE, "100"), metastore.tables().metadata().properties());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 12 with IcebergMetastore

use of org.apache.drill.metastore.iceberg.IcebergMetastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testCreationWithCommonAndComponentProperties.

@Test
public void testCreationWithCommonAndComponentProperties() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()).withValue(String.format(COMPONENTS_COMMON_PROPERTIES_PATTERN, TableProperties.SPLIT_SIZE), ConfigValueFactory.fromAnyRef(10)).withValue(String.format(COMPONENTS_TABLES_PROPERTIES_PATTERN, TableProperties.MANIFEST_MIN_MERGE_COUNT), ConfigValueFactory.fromAnyRef(2)));
    Metastore metastore = new IcebergMetastore(config);
    Map<String, String> expected = new HashMap<>();
    expected.put(TableProperties.SPLIT_SIZE, "10");
    expected.put(TableProperties.MANIFEST_MIN_MERGE_COUNT, "2");
    assertEquals(expected, metastore.tables().metadata().properties());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) HashMap(java.util.HashMap) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Aggregations

DrillConfig (org.apache.drill.common.config.DrillConfig)12 IcebergMetastore (org.apache.drill.metastore.iceberg.IcebergMetastore)12 IcebergBaseTest (org.apache.drill.metastore.iceberg.IcebergBaseTest)10 Test (org.junit.Test)10 Metastore (org.apache.drill.metastore.Metastore)9 HashMap (java.util.HashMap)3 File (java.io.File)2 Metadata (org.apache.drill.metastore.operate.Metadata)2 Config (com.typesafe.config.Config)1 Tables (org.apache.drill.metastore.components.tables.Tables)1 IcebergTables (org.apache.drill.metastore.iceberg.components.tables.IcebergTables)1 Path (org.apache.hadoop.fs.Path)1 BeforeClass (org.junit.BeforeClass)1