You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/01/09 07:00:52 UTC

[GitHub] [calcite] xy2953396112 opened a new pull request #1737: [CALCITE-3718] Support Intersect and Minus in Bindables

xy2953396112 opened a new pull request #1737: [CALCITE-3718] Support Intersect and Minus in Bindables
URL: https://github.com/apache/calcite/pull/1737
 
 
   Intersect and Minus are not supported in Bindables, this pr try support Intersect and Minus in Bindables.

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


With regards,
Apache Git Services

[GitHub] [calcite] danny0405 commented on a change in pull request #1737: [CALCITE-3718] Support Intersect and Minus in Bindables

Posted by GitBox <gi...@apache.org>.
danny0405 commented on a change in pull request #1737: [CALCITE-3718] Support Intersect and Minus in Bindables
URL: https://github.com/apache/calcite/pull/1737#discussion_r366708269
 
 

 ##########
 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:
   Can we have one `BindableXXXRule` and one `BindableXXX` to unify all the set operators ?

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


With regards,
Apache Git Services