@Override
  public String toString() {
    try {
      return getJSONQuery(getQueryPlan());
    } catch (Exception e) {
      LOG.warn("Unable to produce query plan JSON string", e);
      return e.toString();
    }
  }
Extract all the counters from tasks and operators.
ql/src/java/org/apache/hadoop/hive/ql/QueryPlan.java