@Test
  public void testOverwriteCommitHMSFailed() throws TException {
    List<Record> insertRecords = Lists.newArrayList();
    insertRecords.add(tableTestHelper().generateTestRecord(1, "john", 0, "2022-01-01T12:00:00"));
    insertRecords.add(tableTestHelper().generateTestRecord(2, "lily", 0, "2022-01-02T12:00:00"));
    List<DataFile> dataFiles =
        HiveDataTestHelpers.writerOf(getMixedTable()).transactionId(1L).writeHive(insertRecords);
    UnkeyedTable baseStore = MixedTableUtil.baseStore(getMixedTable());
    OverwriteFiles overwriteFiles = baseStore.newOverwrite();
    dataFiles.forEach(overwriteFiles::addFile);

    // rename the hive table,
    Table hiveTable =
        TEST_HMS
            .getHiveClient()
            .getTable(getMixedTable().id().getDatabase(), getMixedTable().id().getTableName());
    hiveTable.setTableName("new_table");
    TEST_HMS
        .getHiveClient()
        .alter_table(
            getMixedTable().id().getDatabase(), getMixedTable().id().getTableName(), hiveTable);

    // commit should success even though hive table is not existed.
    overwriteFiles.commit();

    hiveTable.setTableName(getMixedTable().id().getTableName());
    TEST_HMS
        .getHiveClient()
        .alter_table(getMixedTable().id().getDatabase(), "new_table", hiveTable);
    String tableRootLocation = MixedTableUtil.tableRootLocation(getMixedTable());
    String newTableLocation =
        tableRootLocation.replace(getMixedTable().id().getTableName(), "new_table");
    getMixedTable().io().asFileSystemIO().deletePrefix(newTableLocation);
  }
add file to exist partition, overwrite success without create partition
amoro-format-mixed/amoro-mixed-hive/src/test/java/org/apache/amoro/hive/op/TestOverwriteFiles.java