You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/08/22 11:16:39 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #11867: [improve](nereids): enable exploration

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java:
##########
@@ -51,51 +54,44 @@ enum SwapType {
 
     @Override
     public Rule build() {
-        return innerLogicalJoin(any(), any()).then(join -> {
-            if (!check(join)) {
-                return null;
-            }
-            boolean isBottomJoin = isBottomJoin(join);
-            if (swapType == SwapType.BOTTOM_JOIN && !isBottomJoin) {
-                return null;
-            }
-
+        return innerLogicalJoin().when(this::check).then(join -> {
             LogicalJoin newJoin = new LogicalJoin(
                     join.getJoinType(),
                     join.getCondition(),
                     join.right(), join.left(),
-                    join.getJoinReorderContext()
-            );
+                    join.getJoinReorderContext());
             newJoin.getJoinReorderContext().setHasCommute(true);
-            if (swapType == SwapType.ZIG_ZAG && !isBottomJoin) {
-                newJoin.getJoinReorderContext().setHasCommuteZigZag(true);
-            }
+            // if (swapType == SwapType.ZIG_ZAG && !isBottomJoin(join)) {

Review Comment:
   remove it or add a TODO to explain when to remove comment



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java:
##########
@@ -51,51 +54,44 @@ enum SwapType {
 
     @Override
     public Rule build() {
-        return innerLogicalJoin(any(), any()).then(join -> {
-            if (!check(join)) {
-                return null;
-            }
-            boolean isBottomJoin = isBottomJoin(join);
-            if (swapType == SwapType.BOTTOM_JOIN && !isBottomJoin) {
-                return null;
-            }
-
+        return innerLogicalJoin().when(this::check).then(join -> {

Review Comment:
   remove any will lead to all children of join is GroupPlan and isBottomJoin will always return false



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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