@Test
  public void testAlterTableWithMetadataLocation() throws IOException {
    Assume.assumeTrue("Alter table with metadata location is only supported for Hive Catalog tables",
        testTableType.equals(TestTables.TestTableType.HIVE_CATALOG));
    TableIdentifier tableIdentifier = TableIdentifier.of("default", "source");
    // create a test table with some dummy data
    Table table =
        testTables.createTable(shell, tableIdentifier.name(), HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
            PartitionSpec.unpartitioned(), FileFormat.PARQUET, Collections.emptyList(), 1, Collections.emptyMap());
    testTables.appendIcebergTable(shell.getHiveConf(), table, FileFormat.PARQUET, null,
        HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
    String firstMetadataLocation = ((BaseTable) table).operations().current().metadataFileLocation();
    testTables.appendIcebergTable(shell.getHiveConf(), table, FileFormat.PARQUET, null,
        HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
    table.refresh();
    String secondMetadataLocation = ((BaseTable) table).operations().current().metadataFileLocation();
    Assert.assertNotEquals(firstMetadataLocation, secondMetadataLocation);
    shell.executeStatement("ALTER TABLE " + tableIdentifier.name() + " SET TBLPROPERTIES('metadata_location'='" +
        firstMetadataLocation + "')");
    // during alter operation a new metadata file is created but reflecting the old metadata state
    List<Object[]> rows = shell.executeStatement("SELECT * FROM " + tableIdentifier.name());
    List<Record> records = HiveIcebergTestUtils.valueForRow(table.schema(), rows);
    HiveIcebergTestUtils.validateData(HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS, records, 0);
    // add another batch of data to the table to make sure data manipulation is working
    testTables.appendIcebergTable(shell.getHiveConf(), table, FileFormat.PARQUET, null,
        HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
    rows = shell.executeStatement("SELECT * FROM " + tableIdentifier.name());
    records = HiveIcebergTestUtils.valueForRow(table.schema(), rows);
    HiveIcebergTestUtils.validateData(
        Stream.concat(HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS.stream(),
            HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS.stream()).collect(Collectors.toList()), records, 0);
  }
Checks that HiveIcebergMetaHook doesn't run into failures with undefined alter operation type (e.g. stat updates)
@throws Exception - any test failure
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java