public static PartitionSpec projectPartition(PartitionSpec partitionSpec, Schema schema) {
    PartitionSpec.Builder builder = PartitionSpec.builderFor(schema);

    partitionSpec
        .fields()
        .forEach(
            p -> {
              if (schema.findField(p.sourceId()) == null) {
                return;
              }

              builder.add(p.sourceId(), p.name(), p.transform());
            });
    return builder.build();
  }
Copy an new sort order spec depend on an new schema, new schema should contain the same fields
sort order spec need.

@param sortOrder sort order spec to be copied
@param copySchema schema new partition spec depend on
@return the new partition spec
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/iceberg/IcebergSchemaUtil.java