@Test
  public void testMultipleOperationInTxByOptimize() {
    UnkeyedTable operationTable = getOperationTable();
    Transaction transaction = operationTable.newTransaction();
    transaction
        .newAppend()
        .appendFile(getDataFile(1))
        .appendFile(getDataFile(2))
        .set(SnapshotSummary.SNAPSHOT_PRODUCER, CommitMetaProducer.OPTIMIZE.name())
        .commit();

    transaction
        .newOverwrite()
        .deleteFile(getDataFile(1))
        .addFile(getDataFile(3))
        .set(SnapshotSummary.SNAPSHOT_PRODUCER, CommitMetaProducer.OPTIMIZE.name())
        .commit();

    Assert.assertFalse(
        getAmsHandler()
            .getTableCommitMetas()
            .containsKey(operationTable.id().buildTableIdentifier()));

    transaction.commitTransaction();

    List<Snapshot> snapshots = Lists.newArrayList(operationTable.snapshots());
    Assert.assertEquals(2, snapshots.size());
    List<TableCommitMeta> tableCommitMetas =
        getAmsHandler().getTableCommitMetas().get(operationTable.id().buildTableIdentifier());
    Assert.assertEquals(1, tableCommitMetas.size());
    TableCommitMeta commitMeta = tableCommitMetas.get(0);
    Assert.assertSame(commitMeta.getCommitMetaProducer(), CommitMetaProducer.OPTIMIZE);
    Assert.assertEquals(2, commitMeta.getChanges().size());
    validateTableChange(
        snapshots.get(0),
        commitMeta.getChanges().get(0),
        new org.apache.iceberg.DataFile[] {getDataFile(1), getDataFile(2)},
        new org.apache.iceberg.DataFile[] {});
    validateTableChange(
        snapshots.get(1),
        commitMeta.getChanges().get(1),
        new org.apache.iceberg.DataFile[] {getDataFile(3)},
        new org.apache.iceberg.DataFile[] {getDataFile(1)});
  }
Table trace is disabled for version 0.5.0
amoro-format-iceberg/src/test/java/org/apache/amoro/trace/TestTableTracer.java