[fix](planner) insubquery should always be converted to semi or anti join (#19240)

This commit is contained in:
starocean999
2023-05-04 11:16:18 +08:00
committed by GitHub
parent aaf0ef741e
commit a573e1093a
2 changed files with 12 additions and 4 deletions

View File

@ -822,11 +822,13 @@ public class StmtRewriter {
if (expr instanceof ExistsPredicate) {
joinOp = ((ExistsPredicate) expr).isNotExists() ? JoinOperator.LEFT_ANTI_JOIN :
JoinOperator.LEFT_SEMI_JOIN;
} else if (expr instanceof InPredicate && joinConjunct instanceof FunctionCallExpr
&& (((FunctionCallExpr) joinConjunct).getFnName().getFunction()
.equalsIgnoreCase(BITMAP_CONTAINS))) {
} else if (expr instanceof InPredicate && !(joinConjunct instanceof BitmapFilterPredicate)) {
joinOp = ((InPredicate) expr).isNotIn() ? JoinOperator.LEFT_ANTI_JOIN : JoinOperator.LEFT_SEMI_JOIN;
isInBitmap = true;
if ((joinConjunct instanceof FunctionCallExpr
&& (((FunctionCallExpr) joinConjunct).getFnName().getFunction()
.equalsIgnoreCase(BITMAP_CONTAINS)))) {
isInBitmap = true;
}
} else {
joinOp = JoinOperator.CROSS_JOIN;
// We can equal the aggregate subquery using a cross join. All conjuncts