public static ASTNode join(ASTNode left, ASTNode right, JoinRelType joinType, ASTNode cond) {
    ASTBuilder b = null;

    switch (joinType) {
    case SEMI:
      b = ASTBuilder.construct(HiveParser.TOK_LEFTSEMIJOIN, "TOK_LEFTSEMIJOIN");
      break;
    case INNER:
      b = ASTBuilder.construct(HiveParser.TOK_JOIN, "TOK_JOIN");
      break;
    case LEFT:
      b = ASTBuilder.construct(HiveParser.TOK_LEFTOUTERJOIN, "TOK_LEFTOUTERJOIN");
      break;
    case RIGHT:
      b = ASTBuilder.construct(HiveParser.TOK_RIGHTOUTERJOIN, "TOK_RIGHTOUTERJOIN");
      break;
    case FULL:
      b = ASTBuilder.construct(HiveParser.TOK_FULLOUTERJOIN, "TOK_FULLOUTERJOIN");
      break;
    case ANTI:
      b = ASTBuilder.construct(HiveParser.TOK_LEFTANTISEMIJOIN, "TOK_LEFTANTISEMIJOIN");
      break;
    }

    b.add(left).add(right).add(cond);
    return b.node();
  }
@return an ASTNode representing a (table) reference to a CTE with the specified name and alias.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTBuilder.java