use of org.apache.hadoop.hive.ql.optimizer.physical.BucketingSortingCtx.BucketCol in project hive by apache.
the class BucketingSortingOpProcFactory method getNewBucketCols.
/**
* This is used to construct new lists of bucketed columns where the order of the columns
* hasn't changed, only possibly the name
* @param bucketCols - input bucketed columns
* @param colInfos - List of column infos
* @return output bucketed columns
*/
private static List<BucketCol> getNewBucketCols(List<BucketCol> bucketCols, List<ColumnInfo> colInfos) {
List<BucketCol> newBucketCols = new ArrayList<BucketCol>(bucketCols.size());
for (int i = 0; i < bucketCols.size(); i++) {
BucketCol bucketCol = new BucketCol();
for (Integer index : bucketCols.get(i).getIndexes()) {
// greater than or equal to colInfos.size().
if (index < colInfos.size()) {
bucketCol.addAlias(colInfos.get(index).getInternalName(), index);
} else {
return null;
}
}
newBucketCols.add(bucketCol);
}
return newBucketCols;
}
Aggregations