diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java index 3c04454458e9..31f15d9a694e 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/optimizations/PushdownSubfields.java @@ -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; @@ -408,6 +409,16 @@ public PlanNode visitTableWriter(TableWriterNode node, RewriteContext c return context.defaultRewrite(node, context.get()); } + @Override + public PlanNode visitDelete(DeleteNode node, RewriteContext 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) {