mihaibudiu commented on code in PR #3949:
URL: https://github.com/apache/calcite/pull/3949#discussion_r1744185603


##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -1910,11 +1910,15 @@ private boolean needNewSubQuery(
         return true;
       }
 
+      // Cannot merge two window functions
+      boolean containsOver = containsOver(node);
       if (rel instanceof Project
           && ((Project) rel).containsOver()
-          && maxClause == Clause.SELECT) {
-        // Cannot merge a Project that contains windowed functions onto an

Review Comment:
   you lost this comment. wasn't it useful?



##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -2006,6 +2010,31 @@ private boolean hasSortByOrdinal(@UnknownInitialization 
Result this,
       return false;
     }
 
+    private boolean containsOver(@UnknownInitialization Result this,

Review Comment:
   this looks very much like an unrolled visitor.
   Couldn't the job be done by a shuttle?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to