@Override public PlanNode visitExplainAnalyze(ExplainAnalyzeNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); return new ExplainAnalyzeNode(node.getId(), source, canonicalize(node.getOutputSymbol()), node.isVerbose()); }
@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new ExplainAnalyzeNode(getId(), Iterables.getOnlyElement(newChildren), outputSymbol, isVerbose()); } }
@Override public PhysicalOperation visitExplainAnalyze(ExplainAnalyzeNode node, LocalExecutionPlanContext context) { ExplainAnalyzeContext analyzeContext = explainAnalyzeContext .orElseThrow(() -> new IllegalStateException("ExplainAnalyze can only run on coordinator")); PhysicalOperation source = node.getSource().accept(this, context); OperatorFactory operatorFactory = new ExplainAnalyzeOperatorFactory( context.getNextOperatorId(), node.getId(), analyzeContext.getQueryPerformanceFetcher(), metadata.getFunctionRegistry(), node.isVerbose()); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
private RelationPlan createExplainAnalyzePlan(Analysis analysis, Explain statement) { RelationPlan underlyingPlan = planStatementWithoutOutput(analysis, statement.getStatement()); PlanNode root = underlyingPlan.getRoot(); Scope scope = analysis.getScope(statement); Symbol outputSymbol = symbolAllocator.newSymbol(scope.getRelationType().getFieldByIndex(0)); root = new ExplainAnalyzeNode(idAllocator.getNextId(), root, outputSymbol, statement.isVerbose()); return new RelationPlan(root, scope, ImmutableList.of(outputSymbol)); }
@Override public Void visitExplainAnalyze(ExplainAnalyzeNode node, Integer indent) { print(indent, "- ExplainAnalyze => [%s]", formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public Map<PlanNodeId, SplitSource> visitExplainAnalyze(ExplainAnalyzeNode node, Void context) { return node.getSource().accept(this, context); }
@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new ExplainAnalyzeNode(getId(), Iterables.getOnlyElement(newChildren), outputSymbol, isVerbose()); } }
@Override public PhysicalOperation visitExplainAnalyze(ExplainAnalyzeNode node, LocalExecutionPlanContext context) { ExplainAnalyzeContext analyzeContext = explainAnalyzeContext .orElseThrow(() -> new IllegalStateException("ExplainAnalyze can only run on coordinator")); PhysicalOperation source = node.getSource().accept(this, context); OperatorFactory operatorFactory = new ExplainAnalyzeOperatorFactory( context.getNextOperatorId(), node.getId(), analyzeContext.getQueryPerformanceFetcher(), metadata.getFunctionRegistry(), node.isVerbose()); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
private RelationPlan createExplainAnalyzePlan(Analysis analysis, Explain statement) { RelationPlan underlyingPlan = planStatementWithoutOutput(analysis, statement.getStatement()); PlanNode root = underlyingPlan.getRoot(); Scope scope = analysis.getScope(statement); Symbol outputSymbol = symbolAllocator.newSymbol(scope.getRelationType().getFieldByIndex(0)); root = new ExplainAnalyzeNode(idAllocator.getNextId(), root, outputSymbol, statement.isVerbose()); return new RelationPlan(root, scope, ImmutableList.of(outputSymbol)); }
@Override public Void visitExplainAnalyze(ExplainAnalyzeNode node, Integer indent) { print(indent, "- ExplainAnalyze => [%s]", formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return processChildren(node, indent + 1); }
@Override public Void visitExplainAnalyze(ExplainAnalyzeNode node, Set<Symbol> boundSymbols) { PlanNode source = node.getSource(); source.accept(this, boundSymbols); // visit child return null; }
@Override public PlanNode visitExplainAnalyze(ExplainAnalyzeNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); return new ExplainAnalyzeNode(node.getId(), source, canonicalize(node.getOutputSymbol()), node.isVerbose()); }
@Test(expectedExceptions = IllegalStateException.class) public void testValidateFailed() { // random plan with 2 output nodes PlanNode root = new OutputNode(idAllocator.getNextId(), new ExplainAnalyzeNode(idAllocator.getNextId(), new OutputNode(idAllocator.getNextId(), new ProjectNode(idAllocator.getNextId(), new ValuesNode( idAllocator.getNextId(), ImmutableList.of(), ImmutableList.of()), Assignments.of() ), ImmutableList.of(), ImmutableList.of() ), new Symbol("a"), false), ImmutableList.of(), ImmutableList.of()); new VerifyOnlyOneOutputNode().validate(root, null, null, null, null, WarningCollector.NOOP); } }
@Override public Map<PlanNodeId, SplitSource> visitExplainAnalyze(ExplainAnalyzeNode node, Void context) { return node.getSource().accept(this, context); }
@Test(expectedExceptions = IllegalStateException.class) public void testValidateFailed() { // random plan with 2 output nodes PlanNode root = new OutputNode(idAllocator.getNextId(), new ExplainAnalyzeNode(idAllocator.getNextId(), new OutputNode(idAllocator.getNextId(), new ProjectNode(idAllocator.getNextId(), new ValuesNode( idAllocator.getNextId(), ImmutableList.of(), ImmutableList.of()), Assignments.of() ), ImmutableList.of(), ImmutableList.of() ), new Symbol("a"), false), ImmutableList.of(), ImmutableList.of()); new VerifyOnlyOneOutputNode().validate(root, null, null, null, null, WarningCollector.NOOP); } }
@Override public Void visitExplainAnalyze(ExplainAnalyzeNode node, Set<Symbol> boundSymbols) { PlanNode source = node.getSource(); source.accept(this, boundSymbols); // visit child return null; }
@Override public PlanNode visitExplainAnalyze(ExplainAnalyzeNode node, RewriteContext<Set<Symbol>> context) { return context.defaultRewrite(node, ImmutableSet.copyOf(node.getSource().getOutputSymbols())); }
@Override public PlanNode visitExplainAnalyze(ExplainAnalyzeNode node, RewriteContext<Set<Symbol>> context) { return context.defaultRewrite(node, ImmutableSet.copyOf(node.getSource().getOutputSymbols())); }