@Test
  public void testOverwriteByAddFiles() throws TException {
    String hiveLocation = "test_hive_location";
    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-01T12:00:00"));
    List<DataFile> dataFiles =
        HiveDataTestHelpers.writerOf(getMixedTable())
            .transactionId(1L)
            .customHiveLocation(hiveLocation)
            .writeHive(insertRecords);
    UnkeyedTable baseStore = MixedTableUtil.baseStore(getMixedTable());
    OverwriteFiles overwriteFiles = baseStore.newOverwrite();
    dataFiles.forEach(overwriteFiles::addFile);
    overwriteFiles.commit();
    HiveDataTestHelpers.assertWriteConsistentFilesCommit(getMixedTable());
    dataFiles = HiveDataTestHelpers.lastedAddedFiles(baseStore);
    UpdateHiveFilesTestHelpers.validateHiveTableValues(
        TEST_HMS.getHiveClient(), getMixedTable(), dataFiles);

    insertRecords.clear();
    insertRecords.add(tableTestHelper().generateTestRecord(2, "lily", 0, "2022-01-01T12:00:00"));
    insertRecords.add(tableTestHelper().generateTestRecord(3, "john", 0, "2022-01-01T12:00:00"));
    List<DataFile> newFiles =
        HiveDataTestHelpers.writerOf(getMixedTable())
            .transactionId(2L)
            .customHiveLocation(hiveLocation)
            .writeHive(insertRecords);
    overwriteFiles = baseStore.newOverwrite();
    newFiles.forEach(overwriteFiles::addFile);
    overwriteFiles.commit();
    newFiles = HiveDataTestHelpers.lastedAddedFiles(baseStore);
    List<DataFile> expectFiles = Lists.newArrayList(dataFiles);
    expectFiles.addAll(newFiles);
    UpdateHiveFilesTestHelpers.validateHiveTableValues(
        TEST_HMS.getHiveClient(), getMixedTable(), expectFiles);
  }
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