use of org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx.SortCol in project hive by apache.
the class BucketingSortingOpProcFactory method getNewSortCols.
/**
* This is used to construct new lists of sorted columns where the order of the columns
* hasn't changed, only possibly the name
* @param bucketCols - input sorted columns
* @param colInfos - List of column infos
* @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);
}
return newSortCols;
}
Aggregations