HanumathRao commented on code in PR #3193:
URL: https://github.com/apache/calcite/pull/3193#discussion_r1209078369


##########
core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java:
##########
@@ -3549,7 +3549,17 @@ protected final void createAggImpl(
     // implement HAVING (we have already checked that it is non-trivial)
     relBuilder.push(bb.root());
     if (havingExpr != null) {
-      relBuilder.filter(havingExpr);
+      /* Set the correlation variables used in this sub-query to the filter 
node,
+       * same logic is being used for the filter generated in where clause.
+       */
+      Set<CorrelationId> variableSet = new HashSet<>();
+      if (havingExpr instanceof RexSubQuery) {

Review Comment:
   Added the code changes to find the SubQuery and also a test case to exercise 
this code path. thanks



-- 
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-unsubscr...@calcite.apache.org

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

Reply via email to