sl255051 commented on code in PR #10678: URL: https://github.com/apache/iceberg/pull/10678#discussion_r1699234156
########## api/src/main/java/org/apache/iceberg/PartitionSpec.java: ########## @@ -427,13 +429,21 @@ private void checkForRedundantPartitions(PartitionField field) { dedupFields.put(dedupKey, field); } + public Builder caseSensitive(boolean sensitive) { + this.caseSensitive = sensitive; + return this; + } + public Builder withSpecId(int newSpecId) { this.specId = newSpecId; return this; } private Types.NestedField findSourceColumn(String sourceName) { - Types.NestedField sourceColumn = schema.findField(sourceName); + Types.NestedField sourceColumn = + this.caseSensitive + ? schema.findField(sourceName) + : schema.caseInsensitiveFindField(sourceName); Review Comment: @rdblue The timing of your answer is impeccable because at the very moment I received your response I was debugging that very method, `TypeUtil.indexByLowerCaseName()`, to see how it handles `data` and `DATA`. The answer is that the method does not throw an exception at all. If you start with this schema: ``` Schema schema = new Schema( required(1, "id", Types.IntegerType.get()), required(2, "data", Types.StringType.get()), required(3, "DATA", Types.StringType.get())); ``` then calling `TypeUtil.indexByLowerCaseName()` will return a RegularImmutableMap of ``` { "data": 3, "id": 1 } ``` So either the result is undefined or (by implementation detail) is the ID of the last column with case-insensitive matching name. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org