-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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
Labels
bugSomething isn't workingSomething isn't working