Skip to content

Commit

Permalink
Add estimates to graphviz of the plan
Browse files Browse the repository at this point in the history
  • Loading branch information
fgwang7w authored and yingsu00 committed Dec 30, 2022
1 parent 4250b5c commit f817946
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public String getGraphvizPlan(Session session, Statement statement, Type planTyp
switch (planType) {
case LOGICAL:
Plan plan = getLogicalPlan(session, statement, parameters, warningCollector);
return graphvizLogicalPlan(plan.getRoot(), plan.getTypes(), session, metadata.getFunctionAndTypeManager());
return graphvizLogicalPlan(plan.getRoot(), plan.getTypes(), plan.getStatsAndCosts(), session, metadata.getFunctionAndTypeManager());
case DISTRIBUTED:
SubPlan subPlan = getDistributedPlan(session, statement, parameters, warningCollector);
return graphvizDistributedPlan(subPlan, session, metadata.getFunctionAndTypeManager());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ private static String formatFragment(
return builder.toString();
}

public static String graphvizLogicalPlan(PlanNode plan, TypeProvider types, Session session, FunctionAndTypeManager functionAndTypeManager)
public static String graphvizLogicalPlan(PlanNode plan, TypeProvider types, StatsAndCosts estimatedStatsAndCosts, Session session, FunctionAndTypeManager functionAndTypeManager)
{
// TODO: This should move to something like GraphvizRenderer
PlanFragment fragment = new PlanFragment(
Expand All @@ -429,7 +429,7 @@ public static String graphvizLogicalPlan(PlanNode plan, TypeProvider types, Sess
new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getOutputVariables()),
StageExecutionDescriptor.ungroupedExecution(),
false,
StatsAndCosts.empty(),
estimatedStatsAndCosts,
Optional.empty());
return GraphvizPrinter.printLogical(ImmutableList.of(fragment), session, functionAndTypeManager);
}
Expand Down

0 comments on commit f817946

Please sign in to comment.