sl255051 commented on code in PR #10678:
URL: https://github.com/apache/iceberg/pull/10678#discussion_r1699209144
##########
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:
@stevenzwu @rdblue @RussellSpitzer I suppose the answer to this question is
to NOT use a case-sensitive schema in a case-insensitive way. In other words,
if the schema is case-sensitive and contains columns named Make and MAKE then
the result of calling `caseInsensitiveFindField("Make")` is undefined.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]