static boolean isJoinToken(ASTNode node) {
    return (node.getToken().getType() == HiveParser.TOK_JOIN)
        || (node.getToken().getType() == HiveParser.TOK_CROSSJOIN)
        || isOuterJoinToken(node)
        || (node.getToken().getType() == HiveParser.TOK_LEFTSEMIJOIN)
        || (node.getToken().getType() == HiveParser.TOK_LEFTANTISEMIJOIN)
        || (node.getToken().getType() == HiveParser.TOK_UNIQUEJOIN);
  }
Links tasks based on dependencies among CTEs which have actual tasks.
For example, when materialized CTE X depends on materialized CTE Y,
the leaf tasks of Y must have the root tasks of X as its child tasks.
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java