@SuppressWarnings("unchecked")
  private boolean canBeExpireByPartitionValue(
      ContentFile<?> contentFile, Types.NestedField expireField, Comparable<?> expireValue) {
    PartitionSpec partitionSpec = table.specs().get(contentFile.specId());
    int pos = 0;
    List<Boolean> compareResults = new ArrayList<>();
    for (PartitionField partitionField : partitionSpec.fields()) {
      if (partitionField.sourceId() == expireField.fieldId()) {
        if (partitionField.transform().isVoid()) {
          return false;
        }

        Comparable<?> partitionUpperBound =
            ((SerializableFunction<Comparable<?>, Comparable<?>>)
                    partitionField.transform().bind(expireField.type()))
                .apply(expireValue);
        Comparable<Object> filePartitionValue =
            contentFile.partition().get(pos, partitionUpperBound.getClass());
        int compared = filePartitionValue.compareTo(partitionUpperBound);
        Boolean compareResult =
            expireField.type() == Types.StringType.get() ? compared <= 0 : compared < 0;
        compareResults.add(compareResult);
      }

      pos++;
    }

    return !compareResults.isEmpty() && compareResults.stream().allMatch(Boolean::booleanValue);
  }
Create a filter expression for expired files for the `FILE` level. For the `PARTITION` level,
we need to collect the oldest files to determine if the partition is obsolete, so we will not
filter for expired files at the scanning stage

@param expirationConfig expiration configuration
@param expireTimestamp expired timestamp
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/IcebergTableMaintainer.java