public static StructType partitionType(Table table) {
    Collection<PartitionSpec> specs = table.specs().values();
    return buildPartitionProjectionType("table partition", specs, allFieldIds(specs));
  }
Builds a unified partition type considering all specs in a table.

<p>If there is only one spec, the partition type is that spec's partition type. Whenever there
are multiple specs, the partition type is a struct containing all fields that have ever been a
part of any spec in the table. In other words, the struct fields represent a union of all known
partition fields.

@param table a table with one or many specs
@return the constructed unified partition type
iceberg/patched-iceberg-core/src/main/java/org/apache/iceberg/Partitioning.java