pvary commented on code in PR #14729:
URL: https://github.com/apache/iceberg/pull/14729#discussion_r2580436675
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/EvolveSchemaVisitor.java:
##########
@@ -89,14 +91,23 @@ public Boolean struct(Types.StructType struct, Integer
partnerId, List<Boolean>
Types.StructType partnerStruct = findFieldType(partnerId).asStructType();
String after = null;
for (Types.NestedField targetField : struct.fields()) {
- Types.NestedField nestedField = partnerStruct.field(targetField.name());
+ Types.NestedField nestedField =
+ caseSensitive
+ ? partnerStruct.field(targetField.name())
+ : partnerStruct.caseInsensitiveField(targetField.name());
final String columnName;
if (nestedField != null) {
updateColumn(nestedField, targetField);
columnName = this.existingSchema.findColumnName(nestedField.fieldId());
} else {
addColumn(partnerId, targetField);
- columnName = this.targetSchema.findColumnName(targetField.fieldId());
+ // We need to lookup the proper parent name because the letter case
might be different on
+ // table vs target parent field (e.g. struct1.FIELD2 vs
STRUCT1.STRUCT2). This is actually a
+ // bug in SchemaUpdate#moveAfter(columnName, after) because added
fields are case-sensitive,
+ // even if case sensitivity is disabled on the API.
Review Comment:
Shouldn't we fix the bug instead of working around?
--
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]