eldenmoon commented on code in PR #32225:
URL: https://github.com/apache/doris/pull/32225#discussion_r1525703473
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java:
##########
@@ -331,6 +340,17 @@ public Expression visitUnboundFunction(UnboundFunction
unboundFunction, Expressi
// so wrap COUNT with Nvl to ensure it's result is 0 instead
of null to get the correct result
boundFunction = new Nvl(boundFunction, new BigIntLiteral(0));
}
+
+ if (currentElementAtLevel == 1
+ &&
PushDownToProjectionFunction.validToPushDown(boundFunction)) {
+ // Only rewrite the top level of PushDownToProjectionFunction,
otherwise invalid slot will be generated
+ // currentElementAtLevel == 1 means at the top of element_at
function, other levels will be ignored.
+ currentElementAtLevel = 0;
+ return visitElementAt((ElementAt) boundFunction, context);
+ }
+ if (unboundFunction.getName().equalsIgnoreCase("element_at")) {
Review Comment:
changed to `boundFunction instanceof ElementAt`
--
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]