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

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

commit be3d31ea5a1ac4a4ed800d0649718dcfa4b3b05b
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Thu Sep 21 15:26:59 2023 +0800

    [fix](Nereids) colocate join could not work well on full outer join (#24700)
    
    in previous PR #22979, we fix the output deriver of join. But we forgot
    to change the util method JoinUtils#shouldColocateJoin to adjust the
    change of physical properties derive.
    we could not use join distribution type anymore since join could output
    any distribute for full outer join.
---
 .../main/java/org/apache/doris/nereids/util/JoinUtils.java  | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java
index a13a22ccb6..3e40db15fd 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java
@@ -225,21 +225,14 @@ public class JoinUtils {
                 || 
ConnectContext.get().getSessionVariable().isDisableColocatePlan()) {
             return false;
         }
-        // TODO: not rely on physical properties?
-        DistributionSpec joinDistributionSpec = 
join.getPhysicalProperties().getDistributionSpec();
         DistributionSpec leftDistributionSpec = 
join.left().getPhysicalProperties().getDistributionSpec();
         DistributionSpec rightDistributionSpec = 
join.right().getPhysicalProperties().getDistributionSpec();
         if (!(leftDistributionSpec instanceof DistributionSpecHash)
-                || !(rightDistributionSpec instanceof DistributionSpecHash)
-                || !(joinDistributionSpec instanceof DistributionSpecHash)) {
+                || !(rightDistributionSpec instanceof DistributionSpecHash)) {
             return false;
         }
-        DistributionSpecHash leftHash = (DistributionSpecHash) 
leftDistributionSpec;
-        DistributionSpecHash rightHash = (DistributionSpecHash) 
rightDistributionSpec;
-        DistributionSpecHash joinHash = (DistributionSpecHash) 
joinDistributionSpec;
-        return leftHash.getShuffleType() == ShuffleType.NATURAL
-                && rightHash.getShuffleType() == ShuffleType.NATURAL
-                && joinHash.getShuffleType() == ShuffleType.NATURAL;
+        return couldColocateJoin((DistributionSpecHash) leftDistributionSpec,
+                (DistributionSpecHash) rightDistributionSpec);
     }
 
     /**


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

Reply via email to