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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new c15324b9c1e [fix](planner)join node should output required slot from 
parent node #27526 (#27551)
c15324b9c1e is described below

commit c15324b9c1e7eef34bd8e79086bbe595184eb48c
Author: starocean999 <[email protected]>
AuthorDate: Fri Nov 24 21:33:19 2023 +0800

    [fix](planner)join node should output required slot from parent node #27526 
(#27551)
---
 .../org/apache/doris/planner/JoinNodeBase.java     |  3 +++
 .../test_join_with_projection.groovy               | 31 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
index b635cfda59d..2a0a272e488 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/JoinNodeBase.java
@@ -275,6 +275,9 @@ public abstract class JoinNodeBase extends PlanNode {
         SlotId firstMaterializedSlotId = null;
         for (TupleDescriptor tupleDescriptor : outputTupleDescList) {
             for (SlotDescriptor slotDescriptor : tupleDescriptor.getSlots()) {
+                if ((requiredSlotIdSet != null && 
requiredSlotIdSet.contains(slotDescriptor.getId()))) {
+                    slotDescriptor.setIsMaterialized(true);
+                }
                 if (slotDescriptor.isMaterialized()) {
                     if ((requiredSlotIdSet == null || 
requiredSlotIdSet.contains(slotDescriptor.getId()))) {
                         outputSlotIds.add(slotDescriptor.getId());
diff --git 
a/regression-test/suites/correctness_p0/test_join_with_projection.groovy 
b/regression-test/suites/correctness_p0/test_join_with_projection.groovy
index 68bf349ffc1..5f60b1be326 100644
--- a/regression-test/suites/correctness_p0/test_join_with_projection.groovy
+++ b/regression-test/suites/correctness_p0/test_join_with_projection.groovy
@@ -79,4 +79,35 @@ suite("test_join_with_projection") {
     sql """
         drop table if exists test_join_with_projection_outerjoin_B;
     """
+
+    sql """set enable_nereids_planner=false;"""
+    sql """drop table if exists c5870_t;"""
+    sql """create table  c5870_t ( 
+            order_item_seq_id varchar(80) NOT NULL,
+            last_updated_stamp datetime,
+            quantity DECIMAL(18, 2)
+            )
+            ENGINE=OLAP
+            DISTRIBUTED BY HASH(order_item_seq_id) BUCKETS 1
+            PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1",
+            "in_memory" = "false",
+            "storage_format" = "V2"
+            );
+            """
+    sql """with c5870_t_pk_set AS 
+                (SELECT oi.order_item_seq_id,
+                    oi.quantity
+                FROM `c5870_t` oi
+                WHERE order_item_seq_id >= 
+                    (SELECT last_updated_stamp
+                    FROM `c5870_t` )
+                    ORDER BY  oi.last_updated_stamp limit 1 )
+                SELECT order_item_seq_id
+            FROM 
+                (SELECT oia.order_item_seq_id
+                FROM `c5870_t` oia
+                INNER JOIN c5870_t_pk_set lips
+                    ON true ) oia ;"""
+    sql """drop table if exists c5870_t;"""
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to