### Question:
HiveTables extends BaseMetastoreTables { @Override public Table load(String tableIdentifier) { List<String> parts = DOT.splitToList(tableIdentifier); if (parts.size() == 2) { return load(parts.get(0), parts.get(1)); } throw new UnsupportedOperationException("Could not parse table identifier: " + tableIdentifier); } HiveTables(Configuration conf); @Override Table create(Schema schema, String tableIdentifier); @Override Table create(Schema schema, PartitionSpec spec, Map<String, String> properties, String tableIdentifier); @Override Table load(String tableIdentifier); @Override BaseMetastoreTableOperations newTableOps(Configuration conf, String database, String table);  }### Answer:
@Test public void testExistingTableUpdate() throws TException { com.netflix.iceberg.Table icebergTable = new HiveTables(hiveConf).load(DB_NAME, TABLE_NAME); icebergTable.updateSchema().addColumn("data", Types.LongType.get()).commit(); icebergTable = new HiveTables(hiveConf).load(DB_NAME, TABLE_NAME); Assert.assertEquals(2, metadataVersionFiles(TABLE_NAME).size()); Assert.assertEquals(0, manifestFiles(TABLE_NAME).size()); Assert.assertEquals(altered.asStruct(), icebergTable.schema().asStruct()); final Table table = metastoreClient.getTable(DB_NAME, TABLE_NAME); final List<String> hiveColumns = table.getSd().getCols().stream().map(f -> f.getName()).collect(Collectors.toList()); final List<String> icebergColumns = altered.columns().stream().map(f -> f.name()).collect(Collectors.toList()); Assert.assertEquals(icebergColumns, hiveColumns); }
@Test(expected = CommitFailedException.class) public void testFailure() throws TException { com.netflix.iceberg.Table icebergTable = new HiveTables(hiveConf).load(DB_NAME, TABLE_NAME); final Table table = metastoreClient.getTable(DB_NAME, TABLE_NAME); final String dummyLocation = "dummylocation"; table.getParameters().put(METADATA_LOCATION_PROP, dummyLocation); metastoreClient.alter_table(DB_NAME, TABLE_NAME, table); icebergTable.updateSchema() .addColumn("data", Types.LongType.get()) .commit(); }