This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 1527099e359 [opt](Nereids) forbid one step topn with distribute as 
child (#40066) (#40278)
1527099e359 is described below

commit 1527099e359b7b00bdfa8355044b6aadf15657c2
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Mon Sep 2 22:26:26 2024 +0800

    [opt](Nereids) forbid one step topn with distribute as child (#40066) 
(#40278)
    
    pick from master #40066
---
 .../doris/nereids/properties/ChildrenPropertiesRegulator.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
index c83c0d3582e..5ba1bd87b05 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java
@@ -518,12 +518,16 @@ public class ChildrenPropertiesRegulator extends 
PlanVisitor<Boolean, Void> {
     public Boolean visitPhysicalTopN(PhysicalTopN<? extends Plan> topN, Void 
context) {
         // process must shuffle
         visit(topN, context);
-
         // If child is DistributionSpecGather, topN should forbid two-phase 
topN
         if (topN.getSortPhase() == SortPhase.LOCAL_SORT
                 && 
childrenProperties.get(0).getDistributionSpec().equals(DistributionSpecGather.INSTANCE))
 {
             return false;
         }
+        // forbid one step topn with distribute as child
+        if (topN.getSortPhase() == SortPhase.GATHER_SORT
+                && children.get(0).getPlan() instanceof PhysicalDistribute) {
+            return false;
+        }
         return true;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to