@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new LimitNode(getId(), Iterables.getOnlyElement(newChildren), count, isPartial()); } }
@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new LimitNode(getId(), Iterables.getOnlyElement(newChildren), count, isPartial()); } }
@Override public Result apply(LimitNode limit, Captures captures, Context context) { return Result.ofPlanNode(new ValuesNode(limit.getId(), limit.getOutputSymbols(), ImmutableList.of())); } }
@Override public Result apply(LimitNode limit, Captures captures, Context context) { return Result.ofPlanNode(new ValuesNode(limit.getId(), limit.getOutputSymbols(), ImmutableList.of())); } }
@Override public PlanNode visitLimit(LimitNode node, RewriteContext<Set<Symbol>> context) { ImmutableSet.Builder<Symbol> expectedInputs = ImmutableSet.<Symbol>builder() .addAll(context.get()); PlanNode source = context.rewrite(node.getSource(), expectedInputs.build()); return new LimitNode(node.getId(), source, node.getCount(), node.isPartial()); }
@Override public PlanNode visitLimit(LimitNode node, RewriteContext<Set<Symbol>> context) { ImmutableSet.Builder<Symbol> expectedInputs = ImmutableSet.<Symbol>builder() .addAll(context.get()); PlanNode source = context.rewrite(node.getSource(), expectedInputs.build()); return new LimitNode(node.getId(), source, node.getCount(), node.isPartial()); }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { LimitNode child = captures.get(CHILD); return Result.ofPlanNode( new LimitNode( parent.getId(), child.getSource(), Math.min(parent.getCount(), child.getCount()), parent.isPartial())); } }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { LimitNode child = captures.get(CHILD); return Result.ofPlanNode( new LimitNode( parent.getId(), child.getSource(), Math.min(parent.getCount(), child.getCount()), parent.isPartial())); } }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { TopNNode child = captures.get(CHILD); return Result.ofPlanNode( new TopNNode( parent.getId(), child.getSource(), Math.min(parent.getCount(), child.getCount()), child.getOrderingScheme(), parent.isPartial() ? TopNNode.Step.PARTIAL : TopNNode.Step.SINGLE)); } }
@Override public PhysicalOperation visitLimit(LimitNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); OperatorFactory operatorFactory = new LimitOperatorFactory(context.getNextOperatorId(), node.getId(), node.getCount()); return new PhysicalOperation(operatorFactory, source.getLayout(), context, source); }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { TopNNode child = captures.get(CHILD); return Result.ofPlanNode( new TopNNode( parent.getId(), child.getSource(), Math.min(parent.getCount(), child.getCount()), child.getOrderingScheme(), parent.isPartial() ? TopNNode.Step.PARTIAL : TopNNode.Step.SINGLE)); } }
@Override public Void visitLimit(LimitNode node, Integer indent) { print(indent, "- Limit%s[%s] => [%s]", node.isPartial() ? "Partial" : "", node.getCount(), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public PhysicalOperation visitLimit(LimitNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); OperatorFactory operatorFactory = new LimitOperatorFactory(context.getNextOperatorId(), node.getId(), node.getCount()); return new PhysicalOperation(operatorFactory, source.getLayout(), context, source); }
@Override public Void visitLimit(LimitNode node, Integer indent) { print(indent, "- Limit%s[%s] => [%s]", node.isPartial() ? "Partial" : "", node.getCount(), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { SortNode child = captures.get(CHILD); return Result.ofPlanNode( new TopNNode( parent.getId(), child.getSource(), parent.getCount(), child.getOrderingScheme(), parent.isPartial() ? TopNNode.Step.PARTIAL : TopNNode.Step.SINGLE)); } }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { SortNode child = captures.get(CHILD); return Result.ofPlanNode( new TopNNode( parent.getId(), child.getSource(), parent.getCount(), child.getOrderingScheme(), parent.isPartial() ? TopNNode.Step.PARTIAL : TopNNode.Step.SINGLE)); } }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { AggregationNode child = captures.get(CHILD); return Result.ofPlanNode( new DistinctLimitNode( parent.getId(), child.getSource(), parent.getCount(), false, child.getGroupingKeys(), child.getHashSymbol())); } }
@Override public Result apply(LimitNode parent, Captures captures, Context context) { AggregationNode child = captures.get(CHILD); return Result.ofPlanNode( new DistinctLimitNode( parent.getId(), child.getSource(), parent.getCount(), false, child.getGroupingKeys(), child.getHashSymbol())); } }