This is an automated email from the ASF dual-hosted git repository.
starocean999 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 e8431e1a97f [fix](planner)should not add TupleIsNullPredicate for
inlineview plan (#25338)
e8431e1a97f is described below
commit e8431e1a97f487af092f297537df9201ef308a25
Author: starocean999 <[email protected]>
AuthorDate: Mon Oct 16 15:24:13 2023 +0800
[fix](planner)should not add TupleIsNullPredicate for inlineview plan
(#25338)
---
.../org/apache/doris/planner/SingleNodePlanner.java | 14 --------------
.../correctness_p0/test_outer_join_with_cross_join.out | 3 +++
.../test_outer_join_with_cross_join.groovy | 18 ++++++++++++++++++
3 files changed, 21 insertions(+), 14 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
index e4edb3517a5..8e128b3b4a0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
@@ -47,7 +47,6 @@ import org.apache.doris.analysis.TableRef;
import org.apache.doris.analysis.TableValuedFunctionRef;
import org.apache.doris.analysis.TupleDescriptor;
import org.apache.doris.analysis.TupleId;
-import org.apache.doris.analysis.TupleIsNullPredicate;
import org.apache.doris.catalog.AggregateFunction;
import org.apache.doris.catalog.AggregateType;
import org.apache.doris.catalog.Column;
@@ -74,7 +73,6 @@ import
org.apache.doris.planner.external.paimon.PaimonScanNode;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.rewrite.mvrewrite.MVSelectFailedException;
import org.apache.doris.statistics.StatisticalType;
-import org.apache.doris.thrift.TNullSide;
import org.apache.doris.thrift.TPushAggOp;
import com.google.common.base.Preconditions;
@@ -1571,18 +1569,6 @@ public class SingleNodePlanner {
//set outputSmap to substitute literal in outputExpr
unionNode.setWithoutTupleIsNullOutputSmap(inlineViewRef.getSmap());
unionNode.setOutputSmap(inlineViewRef.getSmap(), analyzer);
- if (analyzer.isOuterJoined(inlineViewRef.getId())) {
- List<Expr> nullableRhs;
- if (analyzer.isOuterJoinedLeftSide(inlineViewRef.getId()))
{
- nullableRhs =
TupleIsNullPredicate.wrapExprs(inlineViewRef.getSmap().getRhs(),
- unionNode.getTupleIds(), TNullSide.LEFT, analyzer);
- } else {
- nullableRhs =
TupleIsNullPredicate.wrapExprs(inlineViewRef.getSmap().getRhs(),
- unionNode.getTupleIds(), TNullSide.RIGHT,
analyzer);
- }
- unionNode.setOutputSmap(
- new
ExprSubstitutionMap(inlineViewRef.getSmap().getLhs(), nullableRhs), analyzer);
- }
return unionNode;
}
}
diff --git
a/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
b/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
index 0a5825a7bb0..e2f2ee9a508 100644
--- a/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
+++ b/regression-test/data/correctness_p0/test_outer_join_with_cross_join.out
@@ -5,3 +5,6 @@
-- !select2 --
1
+-- !select3 --
+1 2023 2023 1
+
diff --git
a/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
b/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
index 507d2755dc2..e0857c31c58 100644
---
a/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
+++
b/regression-test/suites/correctness_p0/test_outer_join_with_cross_join.groovy
@@ -112,6 +112,24 @@ suite("test_outer_join_with_cross_join") {
inner join test_outer_join_with_cross_join_outerjoin_C as ref_4 on
true;
"""
+ sql """set enable_nereids_planner=false;"""
+ qt_select3 """
+ WITH a As(
+ select
+ (case
+ when '年' = '年' then
DATE_FORMAT(date_sub(concat('2023', '-01-01'), interval 0 year), '%Y')
+
+ end) as startdate,
+ (case
+ when '年' = '年' then
DATE_FORMAT(date_sub(concat('2023', '-01-01'), interval 0 year), '%Y')
+
+ end) as enddate
+ )
+ select * from test_outer_join_with_cross_join_outerjoin_A
DMR_POTM, a
+ right join ( select distinct a from
test_outer_join_with_cross_join_outerjoin_B ) DD
+ on DMR_POTM.a =DD.a;
+ """
+
sql """
drop table if exists test_outer_join_with_cross_join_outerjoin_A;
"""
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]