use of com.facebook.presto.operator.SimplePagesIndexComparator in project presto by prestodb.
the class OrderingCompiler method internalCompilePagesIndexOrdering.
@VisibleForTesting
public PagesIndexOrdering internalCompilePagesIndexOrdering(List<Type> sortTypes, List<Integer> sortChannels, List<SortOrder> sortOrders) throws Exception {
requireNonNull(sortChannels, "sortChannels is null");
requireNonNull(sortOrders, "sortOrders is null");
PagesIndexComparator comparator;
try {
Class<? extends PagesIndexComparator> pagesHashStrategyClass = compilePagesIndexComparator(sortTypes, sortChannels, sortOrders);
comparator = pagesHashStrategyClass.newInstance();
} catch (Throwable e) {
log.error(e, "Error compiling comparator for channels %s with order %s", sortChannels, sortChannels);
comparator = new SimplePagesIndexComparator(sortTypes, sortChannels, sortOrders);
}
// we may want to load a separate PagesIndexOrdering for each comparator
return new PagesIndexOrdering(comparator);
}
Aggregations