private static StructLikeMap<Long> readLegacyPartitionProperties(
      UnkeyedTable table, String type) {
    // To be compatible with old Amoro version 0.5.0 which didn't use puffin file and stored the
    // statistics in table properties
    switch (type) {
      case BLOB_TYPE_OPTIMIZED_SEQUENCE:
        return TablePropertyUtil.getPartitionLongProperties(
            table, TableProperties.PARTITION_OPTIMIZED_SEQUENCE);
      case BLOB_TYPE_BASE_OPTIMIZED_TIME:
        return TablePropertyUtil.getPartitionLongProperties(
            table, TableProperties.PARTITION_BASE_OPTIMIZED_TIME);
      default:
        throw new IllegalArgumentException("Unknown type: " + type);
    }
  }
Find the latest valid snapshot which satisfies the condition.

@param table - Iceberg table
@param currentSnapshotId - find from this snapshot
@param condition - the condition to satisfy
@return the latest valid snapshot or null if not exists
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/MixedTableUtil.java