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

lihaopeng 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 fd18e34c0c [Chore](planner) add error information for OnClause contain 
ExistsPredicates (#18090)
fd18e34c0c is described below

commit fd18e34c0cb3b044d68ef09767e177054ac821cc
Author: Pxl <pxl...@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 59ec735de8..9efb474145 100644
--- a/regression-test/suites/query_p0/join/test_join.groovy
+++ b/regression-test/suites/query_p0/join/test_join.groovy
@@ -1106,7 +1106,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-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to