* @return output sorted columns
*/
private static List<SortCol> getNewSortCols(List<SortCol> sortCols, List<ColumnInfo> colInfos) {
List<SortCol> newSortCols = new ArrayList<SortCol>(sortCols.size());
for (int i = 0; i < sortCols.size(); i++) {
SortCol sortCol = new SortCol(sortCols.get(i).getSortOrder());
for (Integer index : sortCols.get(i).getIndexes()) {
// The only time this condition should be false is in the case of dynamic partitioning
if (index < colInfos.size()) {
sortCol.addAlias(colInfos.get(index).getInternalName(), index);
} else {
return null;
}
}
newSortCols.add(sortCol);