public static PartitionSpec getMixedTablePartitionSpecById(MixedTable mixedTable, int specId) {
    if (TableFormat.ICEBERG.equals(mixedTable.format())) {
      return mixedTable.asUnkeyedTable().specs().get(specId);
    } else {
      PartitionSpec spec = mixedTable.spec();
      if (spec.specId() != specId) {
        throw new IllegalArgumentException(
            "Partition spec id " + specId + " not found in table " + mixedTable.name());
      }
      return spec;
    }
  }
Return the {@link PartitionSpec} of the mixed-format table by {@link PartitionSpec#specId()},
Mix format table will return directly after checking}.
amoro-format-iceberg/src/main/java/org/apache/amoro/utils/MixedTableUtil.java