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 2022/04/22 07:53:42 UTC

[incubator-doris] 06/06: [revert] "[Fix bug] fix non-equal out join is not supported (#8857)" (#9150)

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

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

commit 19c9f70de2f0442febd5da989f9260ca5c01e0f8
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Thu Apr 21 18:20:19 2022 +0800

    [revert] "[Fix bug] fix non-equal out join is not supported (#8857)" (#9150)
    
    This PR cause FE ut failed:
    
    InferFiltersRuleTest
    testOn3Tables1stInner2ndRightJoinEqLiteralAt2nd
    testOn3Tables1stInner2ndRightJoinEqLiteralAt3rd
---
 .../java/org/apache/doris/analysis/TableRef.java   | 15 +--------
 .../org/apache/doris/planner/QueryPlanTest.java    | 37 ----------------------
 2 files changed, 1 insertion(+), 51 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
index 4aa0a1dbc0..7e9a509002 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/TableRef.java
@@ -215,14 +215,6 @@ public class TableRef implements ParseNode, Writable {
         return null;
     }
 
-    public boolean isOuterJoin() {
-        if (joinOp != null) {
-            return joinOp == JoinOperator.LEFT_OUTER_JOIN || joinOp == JoinOperator.RIGHT_OUTER_JOIN
-                    || joinOp == JoinOperator.FULL_OUTER_JOIN;
-        }
-        return false;
-    }
-
     public JoinOperator getJoinOp() {
         // if it's not explicitly set, we're doing an inner join
         return (joinOp == null ? JoinOperator.INNER_JOIN : joinOp);
@@ -580,12 +572,7 @@ public class TableRef implements ParseNode, Writable {
     public void rewriteExprs(ExprRewriter rewriter, Analyzer analyzer)
             throws AnalysisException {
         Preconditions.checkState(isAnalyzed);
-        if (onClause != null) {
-            if (isOuterJoin()) {
-                return;
-            }
-            onClause = rewriter.rewrite(onClause, analyzer, ExprRewriter.ClauseType.ON_CLAUSE);
-        }
+        if (onClause != null) onClause = rewriter.rewrite(onClause, analyzer, ExprRewriter.ClauseType.ON_CLAUSE);
     }
 
     private String joinOpToSql() {
diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index e535e6c0ec..20a5c7c704 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -2119,41 +2119,4 @@ public class QueryPlanTest {
         String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
         Assert.assertTrue(explainString.contains("1 | 10 | 1 | 1 | 1"));
     }
-
-    /**
-     * for issue #8856
-    */
-    @Test
-    public void testOutJoinWithOnFalse() throws Exception {
-        connectContext.setDatabase("default_cluster:test");
-        createTable("create table out_join_1\n" +
-                "(\n" +
-                "    k1 int,\n" +
-                "    v int\n" +
-                ")\n" +
-                "DISTRIBUTED BY HASH(k1) BUCKETS 10\n" +
-                "PROPERTIES(\"replication_num\" = \"1\");");
-
-        createTable("create table out_join_2\n" +
-                "(\n" +
-                "    k1 int,\n" +
-                "    v int\n" +
-                ")\n" +
-                "DISTRIBUTED BY HASH(k1) BUCKETS 10\n" +
-                "PROPERTIES(\"replication_num\" = \"1\");");
-
-        String sql = "explain select * from out_join_1 left join out_join_2 on out_join_1.k1 = out_join_2.k1 and 1=2;";
-        String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
-        Assert.assertFalse(explainString.contains("non-equal LEFT OUTER JOIN is not supported"));
-
-        sql = "explain select * from out_join_1 right join out_join_2 on out_join_1.k1 = out_join_2.k1 and 1=2;";
-        explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
-        Assert.assertFalse(explainString.contains("non-equal RIGHT OUTER JOIN is not supported"));
-
-        sql = "explain select * from out_join_1 full join out_join_2 on out_join_1.k1 = out_join_2.k1 and 1=2;";
-        explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, sql);
-        Assert.assertFalse(explainString.contains("non-equal FULL OUTER JOIN is not supported"));
-
-    }
-
 }


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