public static String toString(QueryPlan queryPlan) {
final StringBuilder sb = new StringBuilder("QUERY PLAN");
for (final Component comp : queryPlan.getPlan()) {
sb.append("\n\nComponent ").append(comp.getName());
final ChainOperator chain = comp.getChainOperator();
if (!chain.isEmpty())
sb.append("\n").append(chain);
if (comp.getHashIndexes() != null && !comp.getHashIndexes().isEmpty())
sb.append("\n HashIndexes: ").append(listToStr(comp.getHashIndexes()));
if (comp.getHashExpressions() != null && !comp.getHashExpressions().isEmpty())