private void addCTEAsSubQuery(QB qb, String cteName, String cteAlias)
      throws SemanticException {
    cteAlias = cteAlias == null ? cteName : cteAlias;
    CTEClause cte = findCTEFromName(qb, cteName, aliasToCTEs);
    ASTNode cteQryNode = cte.cteNode;
    QBExpr cteQBExpr = new QBExpr(cteAlias);
    doPhase1QBExpr(cteQryNode, cteQBExpr, qb.getId(), cteAlias, cte.withColList);
    qb.rewriteCTEToSubq(cteAlias, cteName, cteQBExpr);
  }
Goes though the tabref tree and finds the alias for the table. Once found,
it records the table name-> alias association in aliasToTabs. It also makes
an association from the alias to the table AST in parse info.

@return the alias of the table
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java