}
}
}
cols = cppCtx.genColLists(op);
selectDesc conf = op.getConf();
// The input to the select does not matter. Go over the expressions
// and return the ones which have a marked column
cppCtx.getPrunedColLists().put(op, cppCtx.getSelectColsFromChildren(op, cols));
if(conf.isSelStarNoCompute())
return null;
// do we need to prune the select operator?
List<exprNodeDesc> originalColList = op.getConf().getColList();
List<String> columns = new ArrayList<String>();
for (exprNodeDesc expr : originalColList)
Utilities.mergeUniqElems(columns, expr.getCols());
// by now, 'prunedCols' are columns used by child operators, and 'columns'
// are columns used by this select operator.
ArrayList<String> originalOutputColumnNames = conf.getOutputColumnNames();
if (cols.size() < originalOutputColumnNames.size()) {
ArrayList<exprNodeDesc> newColList = new ArrayList<exprNodeDesc>();
ArrayList<String> newOutputColumnNames = new ArrayList<String>();
Vector<ColumnInfo> rs_oldsignature = op.getSchema().getSignature();
Vector<ColumnInfo> rs_newsignature = new Vector<ColumnInfo>();
RowResolver old_rr = cppCtx.getOpToParseCtxMap().get(op).getRR();
RowResolver new_rr = new RowResolver();
for(String col : cols){
int index = originalOutputColumnNames.indexOf(col);
newOutputColumnNames.add(col);
newColList.add(originalColList.get(index));
rs_newsignature.add(rs_oldsignature.get(index));
String[] tabcol = old_rr.reverseLookup(col);
ColumnInfo columnInfo = old_rr.get(tabcol[0], tabcol[1]);
new_rr.put(tabcol[0], tabcol[1], columnInfo);
}
cppCtx.getOpToParseCtxMap().get(op).setRR(new_rr);
op.getSchema().setSignature(rs_newsignature);
conf.setColList(newColList);
conf.setOutputColumnNames(newOutputColumnNames);
handleChildren(op, cols, cppCtx);
}
return null;
}