xy2953396112 commented on a change in pull request #1737:
URL: https://github.com/apache/calcite/pull/1737#discussion_r411455938



##########
File path: core/src/main/java/org/apache/calcite/interpreter/Bindables.java
##########
@@ -545,6 +557,58 @@ public RelNode convert(RelNode rel) {
     }
   }
 
+  /**
+   * Rule to convert an {@link org.apache.calcite.rel.logical.LogicalIntersect}
+   * to a {@link BindableIntersect}.
+   */
+  public static class BindableIntersectRule extends ConverterRule {
+
+    /**
+     * Creates a BindableIntersectRule.
+     *
+     * @param relBuilderFactory Builder for relational expressions
+     */
+    public BindableIntersectRule(RelBuilderFactory relBuilderFactory) {
+      super(LogicalIntersect.class, (Predicate<RelNode>) r -> true,
+          Convention.NONE, BindableConvention.INSTANCE, relBuilderFactory,
+          "BindableIntersectRule");
+    }
+
+    public RelNode convert(RelNode rel) {
+      final LogicalIntersect intersect = (LogicalIntersect) rel;
+      final BindableConvention out = BindableConvention.INSTANCE;
+      final RelTraitSet traitSet = intersect.getTraitSet().replace(out);
+      return new BindableIntersect(rel.getCluster(), traitSet,
+          convertList(intersect.getInputs(), out), intersect.all);
+    }
+  }
+
+  /**
+   * Rule to convert an {@link org.apache.calcite.rel.logical.LogicalMinus}
+   * to a {@link BindableMinus}.
+   */
+  public static class BindableMinusRule extends ConverterRule {

Review comment:
       I think we need to reconginze SqlKind in SetOp, if we run a sql ,  we 
would like to see operators: BindableIntersect、BindableMinus、Bindable rather 
than BindableSetOp.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to