private String findSimpleTableName(ASTNode tabref, int aliasIndex) throws SemanticException {
    assert tabref.getType() == HiveParser.TOK_TABREF;
    ASTNode tableTree = (ASTNode) (tabref.getChild(0));

    String alias;
    if (aliasIndex != 0) {
      alias = unescapeIdentifier(tabref.getChild(aliasIndex).getText());
    }
    else {
      alias = getUnescapedUnqualifiedTableName(tableTree);
    }
    return alias;
  }
DFS-scan the expressionTree to find all aggregation subtrees and put them
in aggregations.

@param expressionTree
@param aggregations
         the key to the HashTable is the toStringTree() representation of
         the aggregation subtree.
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java