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/12 15:42:30 UTC

[GitHub] [calcite] jinxing64 commented on a change in pull request #1749: Refine rules to avoid producing matches that are known to be no-op

jinxing64 commented on a change in pull request #1749: Refine rules to avoid producing matches that are known to be no-op
URL: https://github.com/apache/calcite/pull/1749#discussion_r365591605
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/rules/UnionToDistinctRule.java
 ##########
 @@ -43,7 +43,9 @@
    */
   public UnionToDistinctRule(Class<? extends Union> unionClazz,
       RelBuilderFactory relBuilderFactory) {
-    super(operand(unionClazz, any()), relBuilderFactory, null);
+    super(
+        operandJ(unionClazz, null, union -> !union.all, any()),
+        relBuilderFactory, null);
 
 Review comment:
   Hi @vlsi 
   Shall we do analogous optimization for rules like `ProjectSetOpTransposeRule`, `AggregateUnionAggregateRule`, `AggregateUnionTransposeRule`. I mean check `setOp.all` or `union.all` by `operandJ`, rather than checking in method of `onMatch`, thus to save the "match" to be added into optimizer queue 

----------------------------------------------------------------
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