You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/07 00:58:13 UTC

[doris] 03/07: [Chore](planner) add error information for OnClause contain ExistsPredicates (#18090)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit c4c9e1c1c3663929442ad35033e62907691c62bf
Author: Pxl <px...@qq.com>
AuthorDate: Wed Mar 29 10:47:41 2023 +0800

    [Chore](planner) add error information for OnClause contain ExistsPredicates (#18090)
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/FromClause.java | 5 +++++
 regression-test/suites/query_p0/join/test_join.groovy              | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FromClause.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FromClause.java
index e7470d1855..e1e274a31d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FromClause.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FromClause.java
@@ -136,6 +136,11 @@ public class FromClause implements ParseNode, Iterable<TableRef> {
             }
             tblRef.analyze(analyzer);
             leftTblRef = tblRef;
+            Expr clause = tblRef.getOnClause();
+            if (clause != null && clause.contains(Subquery.class)) {
+                throw new AnalysisException("Not support OnClause contain Subquery, expr:"
+                        + clause.toSql());
+            }
         }
         // Fix the problem of column nullable attribute error caused by inline view + outer join
         changeTblRefToNullable(analyzer);
diff --git a/regression-test/suites/query_p0/join/test_join.groovy b/regression-test/suites/query_p0/join/test_join.groovy
index 56c47e1080..806f56d2d2 100644
--- a/regression-test/suites/query_p0/join/test_join.groovy
+++ b/regression-test/suites/query_p0/join/test_join.groovy
@@ -1098,7 +1098,10 @@ suite("test_join", "query,p0") {
     qt_join_on_predicate6"""select count(a.k1) from baseall a join test b on a.k1 < 10 and a.k1 = b.k1"""
     qt_join_on_predicate7"""SELECT t2.k1,t2.k2,t3.k1,t3.k2 FROM baseall t2 LEFT JOIN test t3 ON t2.k2=t3.k2 WHERE t2.k1 = 4 OR (t2.k1 > 4 AND t3.k1 IS NULL) order by 1, 2, 3, 4"""
 
-
+    test {
+        sql "select a.k1 from baseall a join test b on b.k2 in (select 49) and a.k1 = b.k1 order by k1;"
+        exception "Not support OnClause contain Subquery"
+    }
 
     // <=> test cases
     qt_join41"""select 1 <=> 2, 1 <=> 1, "a"= \"a\""""


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