Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sl255051 opened this issue Jul 9, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@sl255051
Copy link
Contributor

sl255051 commented Jul 9, 2024

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);
  }
@sl255051 sl255051 added the bug Something isn't working label Jul 9, 2024
sl255051 added a commit to Teradata/iceberg that referenced this issue Jul 10, 2024
…onSpec

Make PartitionSpec.Builder search for columns in a case-insensitive way, i.e. `"COLUMN_1" == "column_1"`
@sl255051
Copy link
Contributor Author

I have created a PR to address this issues. Please have a look at #10678

@sl255051
Copy link
Contributor Author

sl255051 commented Sep 3, 2024

This issue has been fixed with the following PR #10678

@sl255051 sl255051 closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant