private Table validateMigration(String tableName, String tblProperties)
      throws TException, InterruptedException {
    List<Object[]> originalResult = shell.executeStatement("SELECT * FROM " + tableName + " ORDER BY a");
    String stmt = "ALTER TABLE " + tableName + " CONVERT TO ICEBERG";
    if (tblProperties != null) {
      stmt = stmt + " " + tblProperties;
    }
    shell.executeStatement(stmt);
    List<Object[]> alterResult = shell.executeStatement("SELECT * FROM " + tableName + " ORDER BY a");
    Assert.assertEquals(originalResult.size(), alterResult.size());
    for (int i = 0; i < originalResult.size(); i++) {
      Assert.assertEquals(originalResult.get(i).length, alterResult.get(i).length);
      for (int j = 0; j < originalResult.get(i).length; j++) {
        Assert.assertEquals(String.valueOf(originalResult.get(i)[j]), String.valueOf(alterResult.get(i)[j]));
      }
    }
    Table hmsTable = shell.metastore().getTable("default", tableName);
    validateSd(hmsTable, "iceberg");
    validateTblProps(hmsTable, true);
    validatePartitions(tableName);
    return hmsTable;
  }
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