SteveStevenpoor commented on code in PR #26627:
URL: https://github.com/apache/flink/pull/26627#discussion_r2135463978


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/rules/logical/FlinkRightJoinToLeftJoinRule.java:
##########
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.rules.logical;
+
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.plan.RelRule;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Join;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rel.logical.LogicalJoin;
+import org.apache.calcite.rel.rules.TransformationRule;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.tools.RelBuilder;
+import org.immutables.value.Value;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Rule to convert RIGHT JOIN to LEFT JOIN since Multi-Way Join operator works 
only with LEFT joins.
+ */
+@Value.Enclosing
+public class FlinkRightJoinToLeftJoinRule extends 
RelRule<FlinkRightJoinToLeftJoinRule.Config>
+        implements TransformationRule {
+
+    public static final FlinkRightJoinToLeftJoinRule INSTANCE =
+            FlinkRightJoinToLeftJoinRule.Config.DEFAULT.toRule();
+
+    /** Creates a FlinkRightJoinToLeftJoinRule. */
+    public FlinkRightJoinToLeftJoinRule(FlinkRightJoinToLeftJoinRule.Config 
config) {
+        super(config);
+    }
+
+    @Override
+    public boolean matches(RelOptRuleCall call) {
+        Join origJoin = call.rel(0);
+        return origJoin.getJoinType() == JoinRelType.RIGHT;
+    }
+
+    @Override
+    public void onMatch(RelOptRuleCall call) {
+        Join origJoin = call.rel(0);
+        RelNode left = call.rel(1);

Review Comment:
   I quickly ran through the rest of the logical rules and they mostly don't 
use final. I don't want to break the general style :)



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to