This is an automated email from the ASF dual-hosted git repository. cambyzju pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new e65b577f90 [fix](InBitmap) Check whether the in bitmap contains correlated subqueries (#15184) e65b577f90 is described below commit e65b577f905eb0f6d3f789d9f216aed0439f73b5 Author: luozenglin <37725793+luozeng...@users.noreply.github.com> AuthorDate: Wed Dec 21 16:52:27 2022 +0800 [fix](InBitmap) Check whether the in bitmap contains correlated subqueries (#15184) --- .../src/main/java/org/apache/doris/analysis/StmtRewriter.java | 4 ++++ regression-test/suites/query_p0/join/test_bitmap_filter.groovy | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java index 17f29404b8..f837bf6af5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StmtRewriter.java @@ -1189,6 +1189,10 @@ public class StmtRewriter { Expr subquerySubstitute = slotRef; if (exprWithSubquery instanceof InPredicate) { if (slotRef.getType().isBitmapType()) { + if (isCorrelated) { + throw new AnalysisException( + "In bitmap does not support correlated subquery: " + exprWithSubquery.toSql()); + } Expr pred = new BitmapFilterPredicate(exprWithSubquery.getChild(0), slotRef, ((InPredicate) exprWithSubquery).isNotIn()); pred.analyze(analyzer); diff --git a/regression-test/suites/query_p0/join/test_bitmap_filter.groovy b/regression-test/suites/query_p0/join/test_bitmap_filter.groovy index d1102ae193..eaa55bc0eb 100644 --- a/regression-test/suites/query_p0/join/test_bitmap_filter.groovy +++ b/regression-test/suites/query_p0/join/test_bitmap_filter.groovy @@ -16,12 +16,11 @@ // under the License. suite("test_bitmap_filter", "query_p0") { - def tbl1 = "bigtable" + def tbl1 = "test_query_db.bigtable" def tbl2 = "bitmap_table" - def tbl3 = "baseall" + def tbl3 = "test_query_db.baseall" sql "set runtime_filter_type = 16" - sql "use test_query_db" sql "DROP TABLE IF EXISTS ${tbl2}" sql """ CREATE TABLE ${tbl2} ( @@ -50,4 +49,9 @@ suite("test_bitmap_filter", "query_p0") { qt_sql5 "select k1, k2 from ${tbl1} where k1 in (select k2 from ${tbl2}) and k2 not in (select k3 from ${tbl2}) order by k1;" qt_sql6 "select k2, count(k2) from ${tbl1} where k1 in (select k2 from ${tbl2}) group by k2 order by k2;" + + test { + sql "select k1, k2 from ${tbl1} b1 where k1 in (select k2 from ${tbl2} b2 where b1.k2 = b2.k1) order by k1;" + exception "In bitmap does not support correlated subquery" + } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org