[fix](inbitmap) forbid having clause to include in bitmap. (#15494)
This commit is contained in:
@ -957,6 +957,13 @@ public class SelectStmt extends QueryStmt {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isContainInBitmap(Expr expr) {
|
||||
List<Expr> inPredicates = Lists.newArrayList();
|
||||
expr.collect(InPredicate.class, inPredicates);
|
||||
return inPredicates.stream().anyMatch(e -> e.getChild(1) instanceof Subquery
|
||||
&& ((Subquery) e.getChild(1)).getStatement().getResultExprs().get(0).getType().isBitmapType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyze aggregation-relevant components of the select block (Group By clause,
|
||||
* select list, Order By clause),
|
||||
@ -1017,6 +1024,10 @@ public class SelectStmt extends QueryStmt {
|
||||
"HAVING clause must not contain analytic expressions: "
|
||||
+ analyticExpr.toSql());
|
||||
}
|
||||
if (isContainInBitmap(havingClauseAfterAnaylzed)) {
|
||||
throw new AnalysisException(
|
||||
"HAVING clause dose not support in bitmap syntax: " + havingClauseAfterAnaylzed.toSql());
|
||||
}
|
||||
}
|
||||
|
||||
if (groupByClause == null && !selectList.isDistinct()
|
||||
|
||||
Reference in New Issue
Block a user