EmmyMiao87 opened a new pull request #3378:
URL: https://github.com/apache/incubator-doris/pull/3378


   Fixed #3377
   
   The correlated slot ref should be bound by the agg tuple of outer query.
   However, the correlated having clause should not be analyzed correctly so 
the result is incorrect.
   For example: SELECT k1 FROM test GROUP BY k1 HAVING EXISTS(SELECT k1 FROM 
baseall GROUP BY k1 HAVING SUM(test.k1) = k1);
   The correlated predicate is not executed.
   
   The limit offset should be rewritten also when there is subquery in having 
clause.
   For example: select k1, count(*) cnt from test group by k1 having k1 in 
(select k1 from baseall order by k1 limit 2) order by k1 limit 5 offset 3;
   The new stmt should has a limit element with offset.
   
   The view which has subquery in having clause should not be created.
   The reason is that the toSql function of query stmt is incorrect when there 
is subquery in having clause.
   So the view def sql is incorrect and could not pass the sql parser.
   Now, the view def sql use the original sql directly to fix this error.
   
   Change-Id: If24206a8dee94013225fe7fdd30ab1fb034de34f


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



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

Reply via email to