docs: public String explainStatement(int i, Database db, boolean getJSONString) {
          AdHocPlannedStatement plannedStatement = plannedStatements.get(i);
          String aggplan = new String(plannedStatement.core.aggregatorFragment, Constants.UTF8ENCODING);
          PlanNodeTree pnt = new PlanNodeTree();
          try {
              String result = null;
              JSONObject jobj = new JSONObject(aggplan);
              if (getJSONString) {
                  result = jobj.toString(4);
              }
              pnt.loadFromJSONPlan(jobj, db);
  
              if (plannedStatement.core.collectorFragment != null) {
                  // multi-partition query plan
                  String collplan = new String(plannedStatement.core.collectorFragment, Constants.UTF8ENCODING);
                  PlanNodeTree collpnt = new PlanNodeTree();
                  // reattach plan fragments
                  JSONObject jobMP = new JSONObject(collplan);
                  collpnt.loadFromJSONPlan(jobMP, db);
                  assert(collpnt.getRootPlanNode() instanceof SendPlanNode);
                  pnt.getRootPlanNode().reattachFragment(collpnt.getRootPlanNode());
                  if (getJSONString) {
                      result += "\n" + jobMP.toString(4);
                  }
              }
              if (! getJSONString) {
                  result = pnt.getRootPlanNode().toExplainPlanString();
              }
              return result;
          }
          catch (JSONException e) {
              System.out.println(e);
              return "Internal Error (JSONException): " + e.getMessage();
          }
      }