@Override protected Void visitQuerySpecification(final QuerySpecification node, final Integer indent) { process(node.getSelect(), indent); append(indent, "FROM "); processRelation(node.getFrom(), indent); builder.append('\n'); append(indent, " "); builder.append('\n'); if (node.getWhere().isPresent()) { append(indent, "WHERE " + ExpressionFormatter.formatExpression(node.getWhere().get())) .append('\n'); } if (node.getGroupBy().isPresent()) { append(indent, "GROUP BY " + (node.getGroupBy().get().isDistinct() ? " DISTINCT " : "") + ExpressionFormatter .formatGroupBy(node.getGroupBy().get().getGroupingElements())) .append('\n'); } if (node.getHaving().isPresent()) { append(indent, "HAVING " + ExpressionFormatter.formatExpression(node.getHaving().get())) .append('\n'); } if (node.getLimit().isPresent()) { append(indent, "LIMIT " + node.getLimit().get()) .append('\n'); } return null; }