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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -1968,11 +1972,11 @@ public PlanFragment visitPhysicalTopN(PhysicalTopN<? 
extends Plan> topN, PlanTra
             sortNode.setLimit(topN.getLimit());
             if (topN.isEnableRuntimeFilter()) {
                 sortNode.setUseTopnOpt(true);
-                PlanNode child = sortNode.getChild(0);
-                Preconditions.checkArgument(child instanceof OlapScanNode,
-                        "topN opt expect OlapScanNode, but we get " + child);
-                OlapScanNode scanNode = ((OlapScanNode) child);
-                scanNode.setUseTopnOpt(true);
+                // PlanNode child = sortNode.getChild(0);
+                // Preconditions.checkArgument(child instanceof OlapScanNode,
+                //         "topN opt expect OlapScanNode, but we get " + 
child);
+                // OlapScanNode scanNode = ((OlapScanNode) child);
+                // scanNode.setUseTopnOpt(true);

Review Comment:
   remove these useless code



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -682,6 +683,9 @@ public PlanFragment visitPhysicalOlapScan(PhysicalOlapScan 
olapScan, PlanTransla
                 )
         );
         
olapScanNode.setPushDownAggNoGrouping(context.getRelationPushAggOp(olapScan.getRelationId()));
+        if (olapScan.getMutableState(MutableState.KEY_TOPNRF_ID).isPresent()) {

Review Comment:
   we'd better not use mutable state to save this info, since it is very easy 
be borken by other rules after TopNScanOpt.



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