Skip to content

Commit

Permalink
fix having clause constant folding (apache#7507)
Browse files Browse the repository at this point in the history
Change-Id: I49d7f2b17e498e8b393a8c67d85aa1196f961393

Co-authored-by: qijianliang01 <qijianliang01@baidu.com>
  • Loading branch information
qidaye and qijianliang01 authored Dec 30, 2021
1 parent 85c30fc commit 0894848
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1394,8 +1394,8 @@ public void collectExprs(Map<String, Expr> exprMap) {

}
if (havingClause != null) {
registerExprId(havingClause);
exprMap.put(havingClause.getId().toString(), havingClause);
registerExprId(havingClauseAfterAnaylzed);
exprMap.put(havingClauseAfterAnaylzed.getId().toString(), havingClauseAfterAnaylzed);
havingClauseAfterAnaylzed.collect(Subquery.class, subqueryExprs);
}
for (Subquery subquery : subqueryExprs) {
Expand Down Expand Up @@ -1501,7 +1501,7 @@ public void putBackExprs(Map<String, Expr> rewrittenExprMap) {
whereClause.collect(Subquery.class, subqueryExprs);
}
if (havingClause != null) {
havingClause = rewrittenExprMap.get(havingClause.getId().toString());
havingClause = rewrittenExprMap.get(havingClauseAfterAnaylzed.getId().toString());
havingClauseAfterAnaylzed.collect(Subquery.class, subqueryExprs);
}

Expand Down

0 comments on commit 0894848

Please sign in to comment.