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 2021/05/27 07:51:23 UTC

[GitHub] [calcite] xy2953396112 opened a new pull request #2419: [CALCITE-4624] When query contains complex function, materialized vie…

xy2953396112 opened a new pull request #2419:
URL: https://github.com/apache/calcite/pull/2419


   …w recognition fails.
   https://issues.apache.org/jira/browse/CALCITE-4624


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



[GitHub] [calcite] zabetak commented on a change in pull request #2419: [CALCITE-4624] When query contains complex function, materialized vie…

Posted by GitBox <gi...@apache.org>.
zabetak commented on a change in pull request #2419:
URL: https://github.com/apache/calcite/pull/2419#discussion_r640758228



##########
File path: core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java
##########
@@ -1755,6 +1758,20 @@ private static boolean sameRelCollectionNoOrderConsidered(
     return true;
   }
 
+  private static @Nullable List<RexNode> compenProjs(List<RexNode> queryRexNodes,
+      List<RexNode> targetRexNodes) {
+    List<RexNode> compenProjs = new ArrayList<>();
+    for (int i = 0; i < queryRexNodes.size(); i++) {
+      RexNode rexNode = queryRexNodes.get(i);
+      int index = targetRexNodes.indexOf(rexNode);
+      if (index < 0) {
+        return null;
+      }
+      compenProjs.add(new RexInputRef(index, rexNode.getType()));
+    }
+    return compenProjs;
+  }
+

Review comment:
       I had the impression that it was the responsibility of the compensation shuttle (`getRexShuttle`) to do this work. Why is it necessary to have a separate method?




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



[GitHub] [calcite] xy2953396112 closed pull request #2419: [CALCITE-4624] When query contains complex function, materialized vie…

Posted by GitBox <gi...@apache.org>.
xy2953396112 closed pull request #2419:
URL: https://github.com/apache/calcite/pull/2419


   


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

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org