Do not put Limit node in TransformExistsApplyToScalarApply
Do not put Limit node since TransformCorrelatedScalarAggregationToJoin
incorrectly supports it.
@@ -25,7 +25,6 @@ import com.facebook.presto.sql.planner.plan.AggregationNode;
import com.facebook.presto.sql.planner.plan.AggregationNode.Aggregation;
import com.facebook.presto.sql.planner.plan.ApplyNode;
import com.facebook.presto.sql.planner.plan.Assignments;
-import com.facebook.presto.sql.planner.plan.LimitNode;
import com.facebook.presto.sql.planner.plan.PlanNode;
import com.facebook.presto.sql.planner.plan.ProjectNode;
import com.facebook.presto.sql.tree.Cast;
@@ -95,12 +94,8 @@ public class TransformExistsApplyToScalarApply
new ProjectNode(
idAllocator.getNextId(),
new AggregationNode(
- idAllocator.getNextId(),
- new LimitNode(
idAllocator.getNextId(),
parent.getSubquery(),
- 1,
- false),
ImmutableMap.of(count, new Aggregation(COUNT_CALL, countSignature, Optional.empty())),
ImmutableList.of(ImmutableList.of()),
AggregationNode.Step.SINGLE,
