stevenzwu commented on code in PR #10678: URL: https://github.com/apache/iceberg/pull/10678#discussion_r1696085669
########## api/src/main/java/org/apache/iceberg/PartitionSpec.java: ########## @@ -390,7 +391,8 @@ Builder checkConflicts(boolean check) { } private void checkAndAddPartitionName(String name, Integer sourceColumnId) { - Types.NestedField schemaField = schema.findField(name); + Types.NestedField schemaField = Review Comment: should this call the `findSourceColumn` method? ########## 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: `caseInsensitiveFindField` uses normalized lower-case string for name -> id indexing. who can ensure the schema don't have two fields with names like `data` and `DATA`? Otherwise, `caseInsensitiveFindField` search is ambiguous. I am wondering if the `caseSensitive` config need to be pushed into the `Schema` and spec? ########## 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; Review Comment: current `caseSensitive(boolean)` seems more consistent with existing code, like `Scan` interface. -- 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