public static StructType groupingKeyType(Schema schema, Collection<PartitionSpec> specs) {
    return buildPartitionProjectionType("grouping key", specs, commonActiveFieldIds(schema, specs));
  }
@Test
  public void testGroupingKeyTypeWithEvolvedUnpartitionedSpec() {
    TestTables.TestTable table =
        TestTables.create(
            tableDir, "test", SCHEMA, PartitionSpec.unpartitioned(), V1_FORMAT_VERSION);

    table.updateSpec().addField(Expressions.bucket("category", 8)).commit();

    assertThat(table.specs()).hasSize(2);

    StructType expectedType = StructType.of();
    StructType actualType = Partitioning.groupingKeyType(table.schema(), table.specs().values());
    assertThat(actualType).isEqualTo(expectedType);
  }