@Test
  public void testOverwritePartitionByExpression() {
    long txId = getMixedTable().asKeyedTable().beginTransaction(System.currentTimeMillis() + "");
    List<Record> newRecords =
        Lists.newArrayList(
            MixedDataTestHelpers.createRecord(7, "777", 0, "2022-01-01T12:00:00"),
            MixedDataTestHelpers.createRecord(8, "888", 0, "2022-01-01T12:00:00"),
            MixedDataTestHelpers.createRecord(9, "999", 0, "2022-01-01T12:00:00"));
    List<DataFile> newFiles =
        MixedDataTestHelpers.writeBaseStore(
            getMixedTable().asKeyedTable(), txId, newRecords, false);
    long before = System.currentTimeMillis();
    OverwriteBaseFiles overwrite = getMixedTable().asKeyedTable().newOverwriteBaseFiles();
    newFiles.forEach(overwrite::addFile);
    overwrite.updateOptimizedSequenceDynamically(txId);
    overwrite.overwriteByRowFilter(
        Expressions.or(
            Expressions.or(
                Expressions.equal("op_time", "2022-01-01T12:00:00"),
                Expressions.equal("op_time", "2022-01-02T12:00:00")),
            Expressions.equal("op_time", "2022-01-04T12:00:00")));

    overwrite.commit();
    long after = System.currentTimeMillis();

    StructLikeMap<Long> partitionOptimizedSequence =
        MixedTableUtil.readOptimizedSequence(getMixedTable().asKeyedTable());
    // expect result: 1,2,4 partition with new txId, 3 partition is null
    Assert.assertEquals(
        txId,
        partitionOptimizedSequence
            .get(MixedDataTestHelpers.recordPartition("2022-01-01T12:00:00"))
            .longValue());
    Assert.assertEquals(
        txId,
        partitionOptimizedSequence
            .get(MixedDataTestHelpers.recordPartition("2022-01-02T12:00:00"))
            .longValue());
    Assert.assertNull(
        partitionOptimizedSequence.get(
            MixedDataTestHelpers.recordPartition("2022-01-03T12:00:00")));
    Assert.assertEquals(
        txId,
        partitionOptimizedSequence
            .get(MixedDataTestHelpers.recordPartition("2022-01-02T12:00:00"))
            .longValue());

    StructLikeMap<Long> partitionOptimizedTime =
        MixedTableUtil.readBaseOptimizedTime(getMixedTable().asKeyedTable());
    // expect result: 1,2,4 partition with new optimized time, 3 partition is null
    assertRange(
        before,
        after,
        partitionOptimizedTime.get(MixedDataTestHelpers.recordPartition("2022-01-01T12:00:00")));
    assertRange(
        before,
        after,
        partitionOptimizedTime.get(MixedDataTestHelpers.recordPartition("2022-01-02T12:00:00")));
    Assert.assertNull(
        partitionOptimizedTime.get(MixedDataTestHelpers.recordPartition("2022-01-03T12:00:00")));
    assertRange(
        before,
        after,
        partitionOptimizedTime.get(MixedDataTestHelpers.recordPartition("2022-01-04T12:00:00")));

    List<Record> rows =
        MixedDataTestHelpers.readKeyedTable(
            getMixedTable().asKeyedTable(), Expressions.alwaysTrue());
    // partition1 -> base[7,8,9]
    // partition3 -> base[3]
    Assert.assertEquals(4, rows.size());

    Set<Integer> resultIdSet = Sets.newHashSet();
    rows.forEach(r -> resultIdSet.add((Integer) r.get(0)));
    Assert.assertTrue(resultIdSet.contains(7));
    Assert.assertTrue(resultIdSet.contains(8));
    Assert.assertTrue(resultIdSet.contains(9));

    Assert.assertTrue(resultIdSet.contains(3));
  }
overwrite all partition, add new data files
amoro-format-iceberg/src/test/java/org/apache/amoro/op/TestOverwriteBaseFile.java