ASTNode genSelectDIAST(RowResolver rr) {
    Map<String, Map<String, ColumnInfo>> map = rr.getRslvMap();
    ASTNode selectDI = new ASTNode(SELECTDI_TOKEN);
    // Note: this will determine the order of columns in the result. For now, the columns for each
    //       table will be together; the order of the tables, as well as the columns within each
    //       table, is deterministic, but undefined - RR stores them in the order of addition.
    for (String tabAlias : map.keySet()) {
      for (Entry<String, ColumnInfo> entry : map.get(tabAlias).entrySet()) {
        selectDI.addChild(buildSelExprSubTree(tabAlias, entry.getKey()));
      }
    }
    return selectDI;
  }
Construct the data structures containing ExprNodeDesc for partition
columns and order columns. Use the input definition to construct the list
of output columns for the ReduceSinkOperator
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java