starocean999 commented on code in PR #66681:
URL: https://github.com/apache/doris/pull/66681#discussion_r3781672470


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownProjectThroughLimit.java:
##########
@@ -49,10 +49,15 @@ public class PushDownProjectThroughLimit extends 
OneRewriteRuleFactory {
 
     @Override
     public Rule build() {
-        return logicalProject(logicalLimit()).thenApply(ctx -> {
-            LogicalProject<LogicalLimit<Plan>> logicalProject = ctx.root;
-            LogicalLimit<Plan> logicalLimit = logicalProject.child();
-            return 
logicalLimit.withChildren(logicalProject.withChildren(logicalLimit.child()));
-        }).toRule(RuleType.PUSH_DOWN_PROJECT_THROUGH_LIMIT);
+        // a project that computes a NoneMovableFunction (e.g. assert_true) 
must not be
+        // pushed below the limit: the limit prunes rows, so assert_true would 
be evaluated
+        // on a different (larger) domain and its error behavior would change.
+        return logicalProject(logicalLimit())
+                .whenNot(LogicalProject::containsNoneMovableFunction)
+                .thenApply(ctx -> {

Review Comment:
   no need change



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