Search in sources :

Example 1 with Metadata

use of org.apache.drill.metastore.operate.Metadata 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());
}
Also used : DrillConfig(org.apache.drill.common.config.DrillConfig) Metadata(org.apache.drill.metastore.operate.Metadata) Tables(org.apache.drill.metastore.components.tables.Tables) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 2 with Metadata

use of org.apache.drill.metastore.operate.Metadata 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)

Aggregations

DrillConfig (org.apache.drill.common.config.DrillConfig)2 IcebergBaseTest (org.apache.drill.metastore.iceberg.IcebergBaseTest)2 IcebergMetastore (org.apache.drill.metastore.iceberg.IcebergMetastore)2 Metadata (org.apache.drill.metastore.operate.Metadata)2 Test (org.junit.Test)2 Metastore (org.apache.drill.metastore.Metastore)1 Tables (org.apache.drill.metastore.components.tables.Tables)1