public static Expression convertPartitionDataToDataFilter(
      MixedTable table, int specId, StructLike partition) {
    PartitionSpec spec = MixedTableUtil.getMixedTablePartitionSpecById(table, specId);
    Schema schema = table.schema();
    Expression filter = Expressions.alwaysTrue();
    for (int i = 0; i < spec.fields().size(); i++) {
      PartitionField partitionField = spec.fields().get(i);
      Types.NestedField sourceField = schema.findField(partitionField.sourceId());
      UnboundTerm transform = Expressions.transform(sourceField.name(), partitionField.transform());

      Class<?> resultType =
          partitionField.transform().getResultType(sourceField.type()).typeId().javaClass();
      Object partitionValue = partition.get(i, resultType);
      if (partitionValue != null) {
        filter = Expressions.and(filter, Expressions.equal(transform, partitionValue));
      } else {
        filter = Expressions.and(filter, Expressions.isNull(transform));
      }
    }
    return filter;
  }
Convert partition data to data filter.

@param table the {@link MixedTable} table
@param specId the partition spec id
@param partition the partition data
@return data filter converted from partition data
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/ExpressionUtil.java