private boolean getTableAliasHelper(ExprNodeDesc en, Set<String> s, Set<ExprNodeDesc> visited) {
      visited.add(en);

      // The current expression node is a column, see if the column alias is already a part of
      // the return set, s. If not and we already have an entry in set s, this is an invalid expression
      // and return false.
      if (en instanceof ExprNodeColumnDesc) {
        if (s.size() > 0 &&
           !s.contains(((ExprNodeColumnDesc)en).getTabAlias())) {
          return false;
        }
        if (s.size() == 0) {
          s.add(((ExprNodeColumnDesc)en).getTabAlias());
        }
        return true;
      }
      if (en.getChildren() == null) {
        return true;
      }

      // Iterative through the children in a DFS manner to see if there is more than 1 table alias
      // referenced by the current expression node.
      for (ExprNodeDesc cn : en.getChildren()) {
        if (visited.contains(cn)) {
          continue;
        }
        if (cn instanceof ExprNodeColumnDesc) {
          s.add(((ExprNodeColumnDesc) cn).getTabAlias());
        } else if (!(cn instanceof ExprNodeConstantDesc)) {
          if (!getTableAliasHelper(cn, s, visited)) {
            return false;
          }
        }
      }
      return true;
    }
Helper used by getTableAlias
@param en Expression Node Descriptor
@param s Set of the table Aliases associated with the current Expression node.
@param visited Visited ExpressionNode set.
@return true if en has at most one table associated with it, else return false.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/PartitionColumnsSeparator.java