use of org.apache.iceberg.StaticTableOperations in project iceberg by apache.
the class BaseSparkAction method newStaticTable.
protected Table newStaticTable(TableMetadata metadata, FileIO io) {
String metadataFileLocation = metadata.metadataFileLocation();
StaticTableOperations ops = new StaticTableOperations(metadataFileLocation, io);
return new BaseTable(ops, metadataFileLocation);
}
use of org.apache.iceberg.StaticTableOperations in project iceberg by apache.
the class TestStaticTable method testLoadFromMetadata.
@Test
public void testLoadFromMetadata() {
Table staticTable = getStaticTable();
Assert.assertTrue("Loading a metadata file based table should return StaticTableOperations", ((HasTableOperations) staticTable).operations() instanceof StaticTableOperations);
}
use of org.apache.iceberg.StaticTableOperations in project iceberg by apache.
the class TestReachableFileUtil method testVersionHintWithStaticTables.
@Test
public void testVersionHintWithStaticTables() {
TableOperations ops = ((HasTableOperations) table).operations();
TableMetadata metadata = ops.current();
String metadataFileLocation = metadata.metadataFileLocation();
StaticTableOperations staticOps = new StaticTableOperations(metadataFileLocation, table.io());
Table staticTable = new BaseTable(staticOps, metadataFileLocation);
String reportedVersionHintLocation = ReachableFileUtil.versionHintLocation(staticTable);
String expectedVersionHintLocation = ops.metadataFileLocation(Util.VERSION_HINT_FILENAME);
Assert.assertEquals(expectedVersionHintLocation, reportedVersionHintLocation);
}
Aggregations