@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new SortNode(getId(), Iterables.getOnlyElement(newChildren), orderingScheme); } }
@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new SortNode(getId(), Iterables.getOnlyElement(newChildren), orderingScheme); } }
@Override public PlanNode visitSort(SortNode node, RewriteContext<Set<Symbol>> context) { Set<Symbol> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderBy())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new SortNode(node.getId(), source, node.getOrderingScheme()); }
@Override public PlanNode visitSort(SortNode node, RewriteContext<Set<Symbol>> context) { Set<Symbol> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderBy())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new SortNode(node.getId(), source, node.getOrderingScheme()); }
@Override @Deprecated public PlanNode visitSort(SortNode node, RewriteContext<LimitContext> context) { LimitContext limit = context.get(); PlanNode rewrittenSource = context.rewrite(node.getSource()); if (limit != null) { return new TopNNode(node.getId(), rewrittenSource, limit.getCount(), node.getOrderingScheme(), TopNNode.Step.SINGLE); } else if (rewrittenSource != node.getSource()) { return new SortNode(node.getId(), rewrittenSource, node.getOrderingScheme()); } return node; }
@Override @Deprecated public PlanNode visitSort(SortNode node, RewriteContext<LimitContext> context) { LimitContext limit = context.get(); PlanNode rewrittenSource = context.rewrite(node.getSource()); if (limit != null) { return new TopNNode(node.getId(), rewrittenSource, limit.getCount(), node.getOrderingScheme(), TopNNode.Step.SINGLE); } else if (rewrittenSource != node.getSource()) { return new SortNode(node.getId(), rewrittenSource, node.getOrderingScheme()); } return node; }
@Override public PlanNode visitSort(SortNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); return new SortNode(node.getId(), source, canonicalizeAndDistinct(node.getOrderingScheme())); }
@Override public Void visitSort(SortNode node, Integer indent) { Iterable<String> keys = Iterables.transform(node.getOrderingScheme().getOrderBy(), input -> input + " " + node.getOrderingScheme().getOrdering(input)); boolean isPartial = false; if (SystemSessionProperties.isDistributedSortEnabled(session)) { isPartial = true; } print(indent, "- %sSort[%s] => [%s]", isPartial ? "Partial" : "", Joiner.on(", ").join(keys), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public Void visitSort(SortNode node, Integer indent) { Iterable<String> keys = Iterables.transform(node.getOrderingScheme().getOrderBy(), input -> input + " " + node.getOrderingScheme().getOrdering(input)); boolean isPartial = false; if (SystemSessionProperties.isDistributedSortEnabled(session)) { isPartial = true; } print(indent, "- %sSort[%s] => [%s]", isPartial ? "Partial" : "", Joiner.on(", ").join(keys), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public PlanNode visitSort(SortNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); return new SortNode(node.getId(), source, canonicalizeAndDistinct(node.getOrderingScheme())); }