SortSpec [] sortSpecs = sortNode.getSortKeys();
Schema sortSchema = new Schema(channel.getPartitionKey());
// calculate the number of maximum query ranges
TupleRange mergedRange = TupleUtil.columnStatToRange(channel.getSchema(), sortSchema, stat.getColumnStats());
RangePartitionAlgorithm partitioner = new UniformRangePartition(sortSchema, mergedRange);
BigDecimal card = partitioner.getTotalCardinality();
// if the number of the range cardinality is less than the desired number of tasks,
// we set the the number of tasks to the number of range cardinality.
int determinedTaskNum;
if (card.compareTo(new BigDecimal(maxNum)) < 0) {
LOG.info("The range cardinality (" + card
+ ") is less then the desired number of tasks (" + maxNum + ")");
determinedTaskNum = card.intValue();
} else {
determinedTaskNum = maxNum;
}
LOG.info("Try to divide " + mergedRange + " into " + determinedTaskNum +
" sub ranges (total units: " + determinedTaskNum + ")");
TupleRange [] ranges = partitioner.partition(determinedTaskNum);
Fragment dummyFragment = new Fragment(scan.getTableName(), tablePath,
CatalogUtil.newTableMeta(scan.getInSchema(), StoreType.CSV),0, 0);
List<String> basicFetchURIs = new ArrayList<String>();