You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/12/16 13:59:05 UTC

[doris] branch master updated: [fix](subquery)fix bug of using constexpr as subquery's output (#15119)

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

yiguolei 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 6d5251af78 [fix](subquery)fix bug of using constexpr as subquery's output (#15119)
6d5251af78 is described below

commit 6d5251af7838518d6d6f377a17297a4a99cb7ead
Author: starocean999 <40...@users.noreply.github.com>
AuthorDate: Fri Dec 16 21:58:58 2022 +0800

    [fix](subquery)fix bug of using constexpr as subquery's output (#15119)
---
 .../apache/doris/planner/SingleNodePlanner.java    |  4 +++-
 .../test_outer_join_with_subquery.out              |  3 +++
 .../test_outer_join_with_subquery.groovy           | 25 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)

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 5e6b779514..5e1973aaed 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
@@ -1608,7 +1608,9 @@ public class SingleNodePlanner {
         }
         // Set output smap of rootNode *before* creating a SelectNode for proper resolution.
         rootNode.setOutputSmap(outputSmap);
-
+        if (rootNode instanceof UnionNode && ((UnionNode) rootNode).isConstantUnion()) {
+            rootNode.setWithoutTupleIsNullOutputSmap(outputSmap);
+        }
         // rootNode.setOutputSmap(ExprSubstitutionMap.compose(inlineViewRef.getBaseTblSmap(),
         //         rootNode.getOutputSmap(), analyzer));
         // Expr.substituteList(inlineViewRef.getViewStmt().getResultExprs(), analyzer.getChangeResSmap());
diff --git a/regression-test/data/correctness_p0/test_outer_join_with_subquery.out b/regression-test/data/correctness_p0/test_outer_join_with_subquery.out
index 72d126351a..875d88ccc5 100644
--- a/regression-test/data/correctness_p0/test_outer_join_with_subquery.out
+++ b/regression-test/data/correctness_p0/test_outer_join_with_subquery.out
@@ -2,3 +2,6 @@
 -- !select --
 1
 
+-- !select --
+1
+
diff --git a/regression-test/suites/correctness_p0/test_outer_join_with_subquery.groovy b/regression-test/suites/correctness_p0/test_outer_join_with_subquery.groovy
index 59bb822e3b..97de116ca1 100644
--- a/regression-test/suites/correctness_p0/test_outer_join_with_subquery.groovy
+++ b/regression-test/suites/correctness_p0/test_outer_join_with_subquery.groovy
@@ -78,6 +78,31 @@ suite("test_outer_join_with_subquery") {
         ) as subq_2 on (subq_1.c1 = subq_2.c2);
     """
 
+    qt_select"""
+        with idm_org_table as (
+        SELECT 
+            1 a
+        ) 
+        select 
+        a 
+        from 
+        test_outer_join_with_subquery_outerjoin_A 
+        where 
+        a in (
+            SELECT 
+            a 
+            from 
+            test_outer_join_with_subquery_outerjoin_B 
+            where 
+            a = (
+                select 
+                a 
+                from 
+                idm_org_table
+            )
+        );
+    """
+
     sql """
         drop table if exists test_outer_join_with_subquery_outerjoin_A;
     """


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