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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java:
##########
@@ -1277,7 +1285,8 @@ private Optional<Expression> bindNestedFields(UnboundSlot 
unboundSlot, Slot slot
                     throw new AnalysisException("No such struct field '" + 
fieldName + "' in '" + lastFieldName + "'");
                 }
                 lastFieldName = fieldName;
-                expression = new ElementAt(expression, new 
StringLiteral(fieldName));
+                // Dereference-created selectors also cross the thrift 
boundary and must use runtime identity.
+                expression = new ElementAt(expression, new 
StringLiteral(field.getName()));

Review Comment:
   Fixed in 458e4651d9. The struct branch in `visitDereferenceExpression` now 
canonicalizes the newly constructed `ElementAt` before returning, because that 
node is not revisited by `visitElementAt`. A regression test covers dotted 
access on a computed `CAST` base with a Unicode selector.



##########
fe/fe-type/src/main/java/org/apache/doris/catalog/StructType.java:
##########
@@ -122,15 +123,15 @@ public boolean supportSubType(Type subType) {
     public void addField(StructField field) {
         field.setPosition(fields.size());
         fields.add(field);
-        fieldMap.put(field.getName().toLowerCase(), field);
+        fieldMap.put(field.getName().toLowerCase(Locale.ROOT), field);
     }
 
     public ArrayList<StructField> getFields() {
         return fields;
     }
 
     public StructField getField(String fieldName) {
-        return fieldMap.get(fieldName.toLowerCase());
+        return fieldMap.get(fieldName.toLowerCase(Locale.ROOT));

Review Comment:
   Fixed in 458e4651d9. Legacy locale-dependent names now use broad case 
folding only when it produces a unique candidate. Exact persisted runtime 
spellings remain accessible, while an ambiguous selector is rejected instead of 
silently choosing the wrong sibling. The new tests cover Gson replay, 
Catalog/Nereids conversion, round-trip conversion, and analyzer rejection.



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