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/12/16 11:36:43 UTC

[GitHub] [calcite] vlsi commented on a change in pull request #2611: [CALCITE-4887] Filter subQuery remove not fully optimized

vlsi commented on a change in pull request #2611:
URL: https://github.com/apache/calcite/pull/2611#discussion_r770460130



##########
File path: core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
##########
@@ -1089,11 +1089,21 @@ private void replaceSubQueries(
       RelOptUtil.Logic logic) {
     findSubQueries(bb, expr, logic, false);
     for (SubQuery node : bb.subQueryList) {
-      substituteSubQuery(bb, node);
+      substituteSubQuery(bb, node, false);
     }
   }
 
-  private void substituteSubQuery(Blackboard bb, SubQuery subQuery) {
+  private void replaceSubQueriesOnFilter(
+      final Blackboard bb,
+      final SqlNode expr,
+      RelOptUtil.Logic logic) {
+    findSubQueries(bb, expr, logic, false);
+    for (SubQuery node : bb.subQueryList) {
+      substituteSubQuery(bb, node, true);
+    }
+  }

Review comment:
       This looks like code duplication with old `replaceSubQueries`.
   
   Can you please rename `replaceSubQueriesOnFilter` to `replaceSubQueries`, and make the old method delegate to the new one?




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