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-unsubscr...@doris.apache.org

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


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

Reply via email to