morrySnow commented on code in PR #23598:
URL: https://github.com/apache/doris/pull/23598#discussion_r1322664876


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java:
##########
@@ -376,8 +392,58 @@ public Expr visitWindowFunction(WindowFunction function, 
PlanTranslatorContext c
 
     }
 
+    public Expr bindLambda(Lambda lambda, PlanTranslatorContext context) {

Review Comment:
   why not use visitLambda?



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindExpression.java:
##########
@@ -752,20 +753,22 @@ private void 
checkIfOutputAliasNameDuplicatedForGroupBy(List<Expression> express
         }
     }
 
-    private <E extends Expression> E checkBound(E expression, Plan plan) {
-        expression.foreachUp(e -> {
-            if (e instanceof UnboundSlot) {
-                UnboundSlot unboundSlot = (UnboundSlot) e;
-                String tableName = 
StringUtils.join(unboundSlot.getQualifier(), ".");
-                if (tableName.isEmpty()) {
-                    tableName = "table list";
-                }
-                throw new AnalysisException("Unknown column '"
-                        + 
unboundSlot.getNameParts().get(unboundSlot.getNameParts().size() - 1)
-                        + "' in '" + tableName + "' in "
-                        + 
plan.getType().toString().substring("LOGICAL_".length()) + " clause");
+    private <E extends Expression> E checkBoundExceptLambda(E expression, Plan 
plan) {
+        if (expression instanceof Lambda) {
+            return expression;
+        }
+        if (expression instanceof UnboundSlot) {
+            UnboundSlot unboundSlot = (UnboundSlot) expression;
+            String tableName = StringUtils.join(unboundSlot.getQualifier(), 
".");
+            if (tableName.isEmpty()) {
+                tableName = "table list";
             }
-        });
+            throw new AnalysisException("Unknown column '"
+                    + 
unboundSlot.getNameParts().get(unboundSlot.getNameParts().size() - 1)
+                    + "' in '" + tableName + "' in "
+                    + plan.getType().toString().substring("LOGICAL_".length()) 
+ " clause");
+        }
+        expression.children().forEach(e -> checkBoundExceptLambda(e, plan));

Review Comment:
   do we check lambda bind?



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