Java Code Examples for org.apache.phoenix.iterate.ResultIterator#explain()

The following examples show how to use org.apache.phoenix.iterate.ResultIterator#explain() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QueryUtil.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static String getExplainPlan(ResultIterator iterator) throws SQLException {
    List<String> steps = Lists.newArrayList();
    iterator.explain(steps);
    StringBuilder buf = new StringBuilder();
    for (String step : steps) {
        buf.append(step);
        buf.append('\n');
    }
    if (buf.length() > 0) {
        buf.setLength(buf.length()-1);
    }
    return buf.toString();
}
 
Example 2
Source File: UnionPlan.java    From phoenix with Apache License 2.0 5 votes vote down vote up
@Override
public ExplainPlan getExplainPlan() throws SQLException {
    List<String> steps = new ArrayList<String>();
    steps.add("UNION ALL OVER " + this.plans.size() + " QUERIES");
    ResultIterator iterator = iterator();
    iterator.explain(steps);
    // Indent plans steps nested under union, except last client-side merge/concat step (if there is one)
    int offset = !orderBy.getOrderByExpressions().isEmpty() && limit != null ? 2 : limit != null ? 1 : 0;
    for (int i = 1 ; i < steps.size()-offset; i++) {
        steps.set(i, "    " + steps.get(i));
    }
    return new ExplainPlan(steps);
}
 
Example 3
Source File: QueryUtil.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static String getExplainPlan(ResultIterator iterator) throws SQLException {
    List<String> steps = Lists.newArrayList();
    iterator.explain(steps);
    StringBuilder buf = new StringBuilder();
    for (String step : steps) {
        buf.append(step);
        buf.append('\n');
    }
    if (buf.length() > 0) {
        buf.setLength(buf.length()-1);
    }
    return buf.toString();
}
 
Example 4
Source File: BaseQueryPlan.java    From phoenix with Apache License 2.0 4 votes vote down vote up
private List<String> getPlanSteps(ResultIterator iterator){
    List<String> planSteps = Lists.newArrayListWithExpectedSize(5);
    iterator.explain(planSteps);
    return planSteps;
}
 
Example 5
Source File: BaseQueryPlan.java    From phoenix with Apache License 2.0 4 votes vote down vote up
private List<String> getPlanSteps(ResultIterator iterator) {
    List<String> planSteps = Lists.newArrayListWithExpectedSize(5);
    iterator.explain(planSteps);
    return planSteps;
}