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

morrysnow 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 36591258499 [fix](planner) should return outputTupleDesc's id instead 
of tupleIds if outputTupleDesc is set in Plan Node (#30150)
36591258499 is described below

commit 36591258499bc98fce0f4a26dfc2d33d7d6982ca
Author: starocean999 <40539150+starocean...@users.noreply.github.com>
AuthorDate: Mon Jan 22 13:35:55 2024 +0800

    [fix](planner) should return outputTupleDesc's id instead of tupleIds if 
outputTupleDesc is set in Plan Node (#30150)
---
 .../java/org/apache/doris/planner/PlanNode.java    |  3 ++
 .../correctness_p0/test_nested_lateral_view.out    | 15 ++++++
 .../correctness_p0/test_nested_lateral_view.groovy | 55 ++++++++++++++++++++++
 3 files changed, 73 insertions(+)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
index 4cc535be09a..24fc40be2e1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
@@ -384,6 +384,9 @@ public abstract class PlanNode extends TreeNode<PlanNode> 
implements PlanStats {
     }
 
     public List<TupleId> getOutputTupleIds() {
+        if (outputTupleDesc != null) {
+            return Lists.newArrayList(outputTupleDesc.getId());
+        }
         return tupleIds;
     }
 
diff --git a/regression-test/data/correctness_p0/test_nested_lateral_view.out 
b/regression-test/data/correctness_p0/test_nested_lateral_view.out
new file mode 100644
index 00000000000..4bac7d8afe3
--- /dev/null
+++ b/regression-test/data/correctness_p0/test_nested_lateral_view.out
@@ -0,0 +1,15 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !select_default --
+a,a,a,a        1
+a,a,a,a        1
+a,a,a,a        1
+a,a,a,a        1
+a,a,a,a        1
+a,a,a,a        1
+a,a,a,a        2
+a,a,a,a        2
+a,a,a,a        2
+a,a,a,a        2
+a,a,a,a        2
+a,a,a,a        2
+
diff --git 
a/regression-test/suites/correctness_p0/test_nested_lateral_view.groovy 
b/regression-test/suites/correctness_p0/test_nested_lateral_view.groovy
new file mode 100644
index 00000000000..1d42331ee88
--- /dev/null
+++ b/regression-test/suites/correctness_p0/test_nested_lateral_view.groovy
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_nested_lateral_view") {
+    sql """set enable_nereids_planner=true;"""
+    sql "SET enable_fallback_to_original_planner=false"
+    sql """drop table if exists ods_42378777c342d2da36d05db875393811;"""
+    sql """CREATE TABLE `ods_42378777c342d2da36d05db875393811` (
+                `57CE5E02901753F7_06a28` varchar(*) NULL,
+                `57CE5E02520653F7_06a28` varchar(*) NULL,
+                `65F695F4519253F7_06a28` varchar(*) NULL,
+                `65E5671F659C6760_06a28` varchar(*) NULL,
+                `57CE5E027A7A683C_06a28` varchar(*) NULL,
+                `57CE5E02767E520653F7_06a28a4` varchar(*) NULL,
+                `65705B575C0F657070B9_06a28a4` varchar(*) NULL,
+                `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq_` DECIMAL(38, 10) NULL,
+                `5F88591A7B2653F7_06a28` varchar(*) NULL
+                ) ENGINE=OLAP
+                DUPLICATE KEY(`57CE5E02901753F7_06a28`)
+                COMMENT 'OLAP'
+                DISTRIBUTED BY RANDOM BUCKETS AUTO
+                PROPERTIES (
+                "replication_allocation" = "tag.location.default: 1",
+                "is_being_synced" = "false",
+                "storage_format" = "V2",
+                "light_schema_change" = "true",
+                "disable_auto_compaction" = "false",
+                "enable_single_replica_compaction" = "false"
+                );"""
+    sql """INSERT INTO ods_42378777c342d2da36d05db875393811 
(`57CE5E02901753F7_06a28`,`57CE5E02520653F7_06a28`,`65F695F4519253F7_06a28`,`65E5671F659C6760_06a28`,`57CE5E027A7A683C_06a28`,`57CE5E02767E520653F7_06a28a4`,`65705B575C0F657070B9_06a28a4`,qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq_,`5F88591A7B2653F7_06a28`)
 VALUES
+         ('a,a,a,a','a;a;a;a','1899-12-31 15:11:22','2024-01-12 00:00:00','a a 
a a','a%a%a%a','33..33.*.@3',3.3300000000,''),
+         ('a,a,a,a','a;a;a;a','1899-12-31 00:11:22','2024-01-10 00:00:00','a a 
a a','a%a%a%a','99..99.*.@9',1.1100000000,'~!@#¥%……&*()——+=【】;‘,。、、'),
+         ('a,a,a,a','a;a;a;a','1899-12-31 12:11:22','2024-01-11 00:00:00','a a 
a a','a%a%a%a','22..22.*.@2',2.2200000000,'131.0');
+    """
+    qt_select_default """select * from (SELECT   `t1`.`k0`,  `f2`.`lt2`
+                        FROM
+                        (
+                        SELECT    `t0`.`57CE5E02901753F7_06a28` as `k0`  FROM  
  `ods_42378777c342d2da36d05db875393811` `t0`
+                        LATERAL VIEW explode(ARRAY(1,2)) `f1` AS `lt1`)`t1`
+                        LATERAL VIEW explode(ARRAY(1,2)) `f2` AS `lt2` ) ttt 
order by 1,2; """
+}


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

Reply via email to