Skip to content

Commit

Permalink
Add delete node processing in subfield prune optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
feilong-liu committed Dec 9, 2024
1 parent 30686ee commit cfb487c
Showing 1 changed file with 11 additions and 0 deletions.
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());
}

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

0 comments on commit cfb487c

Please sign in to comment.