Skip to content

Commit

Permalink
[fix](planner)join node should output required slot from parent node a…
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 authored Nov 24, 2023
1 parent eb250bc commit 59efb1b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ public void initOutputSlotIds(Set<SlotId> requiredSlotIdSet, Analyzer analyzer)
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;"""
}

0 comments on commit 59efb1b

Please sign in to comment.