Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](planner)sort node should materialized required slots for itself #27605

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading