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/21 10:20:25 UTC
[incubator-doris] branch master updated: [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 master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 81ff49f8e3 [revert] "[Fix bug] fix non-equal out join is not supported (#8857)" (#9150)
81ff49f8e3 is described below
commit 81ff49f8e3c1e5ec6f55ed7a1d426dc0275c61cd
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 1ebbb9ec67..4dd95a4b61 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
@@ -218,14 +218,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);
@@ -583,12 +575,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