Gabriel39 commented on code in PR #67166:
URL: https://github.com/apache/doris/pull/67166#discussion_r3911999185


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/StructField.java:
##########
@@ -49,7 +50,23 @@ public StructField(String name, DataType dataType, boolean 
nullable, String comm
 
     public StructField(String name, DataType dataType, boolean nullable, 
String comment,
             boolean commentSpecified) {
+        this(name, name, dataType, nullable, comment, commentSpecified);
+    }
+
+    /**
+     * Creates a field with separate names for case-insensitive runtime lookup 
and external schema spelling.
+     *
+     * @param name field name normalized internally for runtime lookup
+     * @param originalName field spelling preserved for external schema 
metadata
+     * @param dataType field data type
+     * @param nullable whether the field accepts null values
+     * @param comment field comment
+     * @param commentSpecified whether the comment was explicitly specified
+     */
+    public StructField(String name, String originalName, DataType dataType, 
boolean nullable, String comment,
+            boolean commentSpecified) {
         this.name = Objects.requireNonNull(name, "name should not be 
null").toLowerCase();

Review Comment:
   Fixed in a3845bb524. The catalog and Nereids StructField/StructType runtime 
keys, named_struct validation, access-path collection, and nested-column 
pruning now all use Locale.ROOT. The new Turkish-locale tests cover distinct 
uppercase I and dotless ı fields through conversion, expression analysis, 
lookup, and pruning.



##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergComplexTypeDiff.java:
##########
@@ -172,10 +172,11 @@ private static void applyStructChange(UpdateSchema 
updateSchema, String path,
             Types.NestedField oldField = oldFields.get(i);
             Types.NestedField newField = newFields.get(i);
             String fieldPath = path + "." + oldField.name();
-            existingNames.add(oldField.name());
+            existingNames.add(lowercaseName(oldField.name()));
 
-            // Legacy ColumnType rule: existing fields are matched by position 
and may not be renamed.
-            if (!oldField.name().equals(newField.name())) {
+            // Iceberg defines case-insensitive identity with ROOT-lowercase 
keys. Java equalsIgnoreCase is
+            // broader for some Unicode characters and could otherwise route 
an update to the wrong field.
+            if 
(!lowercaseName(oldField.name()).equals(lowercaseName(newField.name()))) {

Review Comment:
   Fixed in a3845bb524. Flat Iceberg MODIFY now resolves the top-level field 
case-insensitively, uses current.name() for every staged type, doc, 
nullability, and position update, and resolves AFTER references to their 
persisted spelling. The catalog-backed test covers both primitive and complex 
updates with mismatched root casing and a mismatched AFTER sibling.



-- 
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]

Reply via email to