github-actions[bot] commented on code in PR #67166:
URL: https://github.com/apache/doris/pull/67166#discussion_r3916289666
##########
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:
[P1] Canonicalize computed dotted dereferences too
This line fixes only the `UnboundSlot` path handled by `bindNestedFields`. A
computed base such as ``(CAST(payload AS STRUCT<`Σ`:BIGINT>)).`Σ` `` is parsed
as `DereferenceExpression`; `visitDereferenceExpression` resolves the field but
returns `new ElementAt(expression, dereferenceExpression.child(1))`, and that
newly created node is not revisited by `visitElementAt`. The selector therefore
remains `Σ` while the cast/thrift struct field is `σ`, so BE's bytewise
`iequal` lookup still reports the field missing. This is a separate analyzer
branch from the existing direct-selector thread. Please canonicalize the
resolved field in `visitDereferenceExpression` too (or share one helper) and
add a computed-base dotted-access test.
--
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]