This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit 4a1bcebf411cba02228ea35347e5d39dd7569fba Author: starocean999 <40539150+starocean...@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-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org