public static SortOrder buildSortOrder(Table table) {
    return buildSortOrder(table.schema(), table.spec(), table.sortOrder());
  }
@Test
  public void testSortOrderClusteringAllPartitionFieldsReordered() {
    PartitionSpec spec = PartitionSpec.builderFor(SCHEMA).identity("category").day("ts").build();
    SortOrder order =
        SortOrder.builderFor(SCHEMA)
            .withOrderId(1)
            .asc(Expressions.day("ts"))
            .asc("category")
            .desc("id")
            .build();

    assertThat(SortOrderUtil.buildSortOrder(SCHEMA, spec, order))
        .as("Should leave the order unchanged")
        .isEqualTo(order);
  }