JingsongLi commented on a change in pull request #8898: 
[FLINK-12936][table-planner-blink] Support intersect all / minus all to blink 
planner
URL: https://github.com/apache/flink/pull/8898#discussion_r300532548
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/rules/logical/ReplaceIntersectWithSemiJoinRule.scala
 ##########
 @@ -18,25 +18,26 @@
 
 package org.apache.flink.table.plan.rules.logical
 
+import 
org.apache.flink.table.plan.util.SetOpRewriteUtil.generateEqualsCondition
+
+import org.apache.calcite.plan.RelOptRule.{any, operand}
 import org.apache.calcite.plan.{RelOptRule, RelOptRuleCall}
-import org.apache.calcite.rel.core.{Aggregate, Intersect, Join, JoinRelType}
+import org.apache.calcite.rel.core.{Aggregate, Intersect, Join, JoinRelType, 
RelFactories}
 
 import scala.collection.JavaConversions._
 
 /**
   * Planner rule that replaces distinct [[Intersect]] with
   * a distinct [[Aggregate]] on a SEMI [[Join]].
-  *
-  * <p>Note: Not support Intersect All.
   */
-class ReplaceIntersectWithSemiJoinRule extends ReplaceSetOpWithJoinRuleBase(
-  classOf[Intersect],
+class ReplaceIntersectWithSemiJoinRule extends RelOptRule(
+  operand(classOf[Intersect], any),
+  RelFactories.LOGICAL_BUILDER,
   "ReplaceIntersectWithSemiJoinRule") {
 
   override def matches(call: RelOptRuleCall): Boolean = {
     val intersect: Intersect = call.rel(0)
-    // not support intersect all now.
-    intersect.isDistinct
+    intersect.isDistinct && intersect.getInputs.size() == 2
 
 Review comment:
   OK, Use all `SetOp.all` and I will add comment to explain these rules just 
handle the case of input size 2

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to