Search in sources :

Example 1 with JsonPlanFragment

use of com.facebook.presto.sql.planner.planPrinter.JsonRenderer.JsonPlanFragment in project presto by prestodb.

the class PlanPrinter method formatJsonFragmentList.

private static String formatJsonFragmentList(List<PlanFragment> fragments) {
    ImmutableSortedMap.Builder<PlanFragmentId, JsonPlanFragment> fragmentJsonMap = ImmutableSortedMap.naturalOrder();
    for (PlanFragment fragment : fragments) {
        PlanFragmentId fragmentId = fragment.getId();
        JsonPlanFragment jsonPlanFragment = new JsonPlanFragment(fragment.getJsonRepresentation().get());
        fragmentJsonMap.put(fragmentId, jsonPlanFragment);
    }
    return new JsonRenderer().render(fragmentJsonMap.build());
}
Also used : ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) PlanFragmentId(com.facebook.presto.sql.planner.plan.PlanFragmentId) JsonPlanFragment(com.facebook.presto.sql.planner.planPrinter.JsonRenderer.JsonPlanFragment) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) JsonPlanFragment(com.facebook.presto.sql.planner.planPrinter.JsonRenderer.JsonPlanFragment)

Aggregations

PlanFragment (com.facebook.presto.sql.planner.PlanFragment)1 PlanFragmentId (com.facebook.presto.sql.planner.plan.PlanFragmentId)1 JsonPlanFragment (com.facebook.presto.sql.planner.planPrinter.JsonRenderer.JsonPlanFragment)1 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1