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 16:32:43 UTC

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

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

 ##########
 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:
   That is true: it is better to use `operandJ` or `matches` methods to reduce the planning overhead.
   
   I improved the rules that produced lots of false positives in MaterializedTest, and I have not verified other rules.
   

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