morningman commented on a change in pull request #3150: Support non-correlated 
subquery in having clause
URL: https://github.com/apache/incubator-doris/pull/3150#discussion_r396198048
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/analysis/StmtRewriter.java
 ##########
 @@ -97,8 +104,142 @@ private static void rewriteSelectStatement(SelectStmt 
stmt, Analyzer analyzer)
             }
             rewriteWhereClauseSubqueries(stmt, analyzer);
         }
+        // Rewrite all subquery in the having clause
+        if (stmt.getHavingPred() != null && stmt.getHavingPred().getSubquery() 
!= null) {
+            stmt = rewriteHavingClauseSubqueries(stmt, analyzer);
+        }
         stmt.sqlString_ = null;
         if (LOG.isDebugEnabled()) LOG.debug("rewritten stmt: " + stmt.toSql());
+        return stmt;
 
 Review comment:
   Not returning the `parameter`, use local variable instead.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to