eldenmoon commented on code in PR #32225: URL: https://github.com/apache/doris/pull/32225#discussion_r1524733506
########## 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: increase and decrease condition should be symmetrical? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org