Skip to content

Commit

Permalink
[fix](planner)sort node should materialized required slots for itself a…
Browse files Browse the repository at this point in the history
  • Loading branch information
starocean999 authored and eldenmoon committed Dec 3, 2023
1 parent 2956330 commit 7dfcfbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@ 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 @@ -269,6 +269,13 @@ public void getMaterializedIds(Analyzer analyzer, List<SlotId> ids) {
Expr.getIds(info.getOrderingExprs(), null, ids);
}

@Override
public void initOutputSlotIds(Set<SlotId> requiredSlotIdSet, Analyzer analyzer) {
// need call materializeRequiredSlots again to make sure required slots is materialized by children
// requiredSlotIdSet parameter means nothing for sort node, just call materializeRequiredSlots is enough
info.materializeRequiredSlots(analyzer, outputSmap);
}

private void removeUnusedExprs() {
if (!isUnusedExprRemoved) {
if (resolvedTupleExprs != null) {
Expand Down

0 comments on commit 7dfcfbd

Please sign in to comment.