@Test
  public void testTraceRemovePosDeleteInternalInTransaction() throws Exception {
    Assume.assumeTrue(isKeyedTable() && onBaseTable);
    getMixedTable().asKeyedTable().baseTable().newAppend().appendFile(getDataFile(1)).commit();

    SortedPosDeleteWriter<Record> writer =
        GenericTaskWriters.builderFor(getMixedTable().asKeyedTable())
            .withTransactionId(1L)
            .buildBasePosDeleteWriter(2, 1, getDataFile(1).partition());
    writer.delete(getDataFile(1).path(), 1);
    writer.delete(getDataFile(1).path(), 3);
    writer.delete(getDataFile(1).path(), 5);
    List<DeleteFile> result = writer.complete();
    RowDelta rowDelta = getMixedTable().asKeyedTable().baseTable().newRowDelta();
    result.forEach(rowDelta::addDeletes);
    rowDelta.commit();

    getMixedTable().asKeyedTable().baseTable().newAppend().appendFile(getDataFile(3)).commit();
    Transaction transaction = getMixedTable().asKeyedTable().baseTable().newTransaction();
    OverwriteFiles overwriteFiles = transaction.newOverwrite();
    overwriteFiles.deleteFile(getDataFile(1));
    overwriteFiles.addFile(getDataFile(2));
    overwriteFiles.commit();
    DeleteFiles deleteFiles = transaction.newDelete();
    deleteFiles.deleteFile(getDataFile(3));
    deleteFiles.commit();
    transaction.commitTransaction();

    List<TableCommitMeta> tableCommitMetas =
        getAmsHandler().getTableCommitMetas().get(getMixedTable().id().buildTableIdentifier());
    Assert.assertEquals(4, tableCommitMetas.size());
    TableCommitMeta commitMeta = tableCommitMetas.get(tableCommitMetas.size() - 1);
    Assert.assertEquals(2, commitMeta.getChanges().size());
    TableChange tableChange = commitMeta.getChanges().get(0);
    Assert.assertEquals(2, tableChange.deleteFiles.size());
  }
Table trace is disabled for version 0.5.0
amoro-format-iceberg/src/test/java/org/apache/amoro/trace/TestTableTracer.java