Search in sources :

Example 1 with Metastore

use of org.apache.drill.metastore.Metastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testLoadWithSameProperties.

@Test
public void testLoadWithSameProperties() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()).withValue(String.format(COMPONENTS_COMMON_PROPERTIES_PATTERN, TableProperties.SPLIT_SIZE), ConfigValueFactory.fromAnyRef(10)));
    Map<String, String> initialProperties = Collections.singletonMap(TableProperties.SPLIT_SIZE, "10");
    Metastore initialMetastore = new IcebergMetastore(config);
    assertEquals(initialProperties, initialMetastore.tables().metadata().properties());
    Metastore newMetastore = new IcebergMetastore(config);
    assertEquals(initialProperties, newMetastore.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 2 with Metastore

use of org.apache.drill.metastore.Metastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testNewInstance.

@Test
public void testNewInstance() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore metastore = new IcebergMetastore(config);
    assertNotSame(metastore.tables(), metastore.tables());
}
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 3 with Metastore

use of org.apache.drill.metastore.Metastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testLoadWithoutProperties.

@Test
public void testLoadWithoutProperties() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore initialMetastore = new IcebergMetastore(config);
    assertTrue(initialMetastore.tables().metadata().properties().isEmpty());
    Metastore newMetastore = new IcebergMetastore(config);
    assertTrue(newMetastore.tables().metadata().properties().isEmpty());
}
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 4 with Metastore

use of org.apache.drill.metastore.Metastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testVersionInitial.

@Test
public void testVersionInitial() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore metastore = new IcebergMetastore(config);
    Metadata metadata = metastore.tables().metadata();
    assertTrue(metadata.supportsVersioning());
    assertEquals(0, metadata.version());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) Metadata(org.apache.drill.metastore.operate.Metadata) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 5 with Metastore

use of org.apache.drill.metastore.Metastore in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testCreationWithoutProperties.

@Test
public void testCreationWithoutProperties() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore metastore = new IcebergMetastore(config);
    assertTrue(metastore.tables().metadata().properties().isEmpty());
}
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)

Aggregations

DrillConfig (org.apache.drill.common.config.DrillConfig)9 Metastore (org.apache.drill.metastore.Metastore)9 IcebergBaseTest (org.apache.drill.metastore.iceberg.IcebergBaseTest)9 IcebergMetastore (org.apache.drill.metastore.iceberg.IcebergMetastore)9 Test (org.junit.Test)9 HashMap (java.util.HashMap)3 Metadata (org.apache.drill.metastore.operate.Metadata)1