@Override
public Void visitJoin(JoinNode node, Integer indent)
{
List<Expression> joinExpressions = new ArrayList<>();
for (JoinNode.EquiJoinClause clause : node.getCriteria()) {
joinExpressions.add(clause.toExpression());
}
node.getFilter().ifPresent(joinExpressions::add);
if (node.isCrossJoin()) {
checkState(joinExpressions.isEmpty());
print(indent, "- CrossJoin => [%s]", formatOutputs(node.getOutputSymbols()));
}
else {
print(indent, "- %s[%s]%s => [%s]",
node.getType().getJoinLabel(),
Joiner.on(" AND ").join(joinExpressions),
formatHash(node.getLeftHashSymbol(), node.getRightHashSymbol()),
formatOutputs(node.getOutputSymbols()));
}
node.getDistributionType().ifPresent(distributionType -> print(indent + 2, "Distribution: %s", distributionType));
node.getSortExpressionContext().ifPresent(context -> print(indent + 2, "SortExpression[%s]", context.getSortExpression()));
printPlanNodesStatsAndCost(indent + 2, node);
printStats(indent + 2, node.getId());
node.getLeft().accept(this, indent + 1);
node.getRight().accept(this, indent + 1);
return null;
}