Skip to content

PartitionSpec.Builder does not support column name case-insensitivity #10668

@sl255051

Description

@sl255051

Apache Iceberg version

None

Query engine

None

Please describe the bug 🐞

PartitionSpec.Builder can only build a partition spec when column names match in a case-sensitive way.

I've written a unit test (included below) that reproduces the issue. You can add this unit test to the TestPartitionSpecInfo class. The test fails at PartitionSpec.builderFor(schema).identity("DATA") because the schema's column is defined with the name "data" but the builder is looking for "DATA".

  @TestTemplate
  public void testSpecInfoPartitionedTableCaseInsensitive() {
    PartitionSpec spec = PartitionSpec.builderFor(schema).identity("DATA").build();
    TestTables.TestTable table = TestTables.create(tableDir, "test", schema, spec, formatVersion);

    assertThat(table.spec()).isEqualTo(spec);
    assertThat(table.spec().lastAssignedFieldId()).isEqualTo(spec.lastAssignedFieldId());
    assertThat(table.specs())
            .containsExactly(entry(spec.specId(), spec))
            .doesNotContainKey(Integer.MAX_VALUE);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions