@Test
  public void testMigrateHiveTableToIcebergWithTBLPROPERTIES() throws TException, InterruptedException {
    String tableName = "tbl";
    String createQuery = "CREATE EXTERNAL TABLE " + tableName + " (a int) STORED AS " + fileFormat.name() + " " +
        testTables.locationForCreateTableSQL(TableIdentifier.of("default", tableName)) +
        testTables.propertiesForCreateTableSQL(Collections.singletonMap("random.prop", "random"));
    shell.executeStatement(createQuery);
    shell.executeStatement("INSERT INTO " + tableName + " VALUES (1), (2), (3)");
    Table hmsTable = validateMigration(tableName, "TBLPROPERTIES('external.table.purge'='true')");

    // Check the new property gets set.
    Assert.assertEquals("true", hmsTable.getParameters().get("external.table.purge"));
    // Check the exiting property stays as is.
    Assert.assertEquals("random", hmsTable.getParameters().get("random.prop"));

    // Check the new property gets translated to iceberg equivalent and gets set.
    org.apache.iceberg.Table icebergTable = testTables.loadTable(TableIdentifier.of("default", tableName));
    Assert.assertEquals("true", icebergTable.properties().get(TableProperties.GC_ENABLED));

    // Retry migration after table is already of iceberg type.
    AssertHelpers.assertThrows("Should throw exception", IllegalArgumentException.class,
        "Can not convert table to ICEBERG ,Table is already of that format", () -> {
          shell.executeStatement("ALTER TABLE " + tableName + " CONVERT TO ICEBERG");
        });
  }
Tests table migration from native Hive tables to Iceberg backed tables (with the same underlying fileformat).
Migration on the original tables is done by setting HiveIcebergStorageHandler on them, contents later should be
verified by a select query.
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergMigration.java