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

Add delete node processing in subfield prune optimizer #24206

Merged
merged 1 commit into from
Dec 9, 2024
Merged
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 @@ -35,6 +35,7 @@
import com.facebook.presto.spi.function.StandardFunctionResolution;
import com.facebook.presto.spi.plan.AggregationNode;
import com.facebook.presto.spi.plan.CteProducerNode;
import com.facebook.presto.spi.plan.DeleteNode;
import com.facebook.presto.spi.plan.DistinctLimitNode;
import com.facebook.presto.spi.plan.EquiJoinClause;
import com.facebook.presto.spi.plan.FilterNode;
Expand Down Expand Up @@ -408,6 +409,16 @@ public PlanNode visitTableWriter(TableWriterNode node, RewriteContext<Context> c
return context.defaultRewrite(node, context.get());
}

@Override
public PlanNode visitDelete(DeleteNode node, RewriteContext<Context> context)
{
if (node.getInputDistribution().isPresent()) {
context.get().variables.addAll(node.getInputDistribution().get().getInputVariables());
}
context.get().variables.add(node.getRowId());
return context.defaultRewrite(node, context.get());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaystarshot can you review again? I just changed this line from return super.visitDelete(node, context); to context.defaultRewrite(node, context.get()) like other functions in this class. Thanks!

}

@Override
public PlanNode visitTopN(TopNNode node, RewriteContext<Context> context)
{
Expand Down
Loading