use of org.apache.drill.metastore.iceberg.IcebergMetastore 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());
}
use of org.apache.drill.metastore.iceberg.IcebergMetastore 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());
}
use of org.apache.drill.metastore.iceberg.IcebergMetastore 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());
}
use of org.apache.drill.metastore.iceberg.IcebergMetastore in project drill by apache.
the class TestIcebergTablesMetastoreConfigAndVersion method testVersionUpdate.
@Test
public void testVersionUpdate() {
DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
Tables tables = new IcebergMetastore(config).tables();
Metadata metadata = tables.metadata();
assertTrue(metadata.supportsVersioning());
assertEquals(0, metadata.version());
tables.modify().overwrite(TableMetadataUnit.builder().storagePlugin("dfs").workspace("tmp").tableName("nation").metadataKey("dir0").build()).execute();
assertNotEquals(0, metadata.version());
}
use of org.apache.drill.metastore.iceberg.IcebergMetastore 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());
}
Aggregations