use of io.prestosql.operator.PagesIndex in project hetu-core by openlookeng.
the class PagesIndexPageSorter method sort.
@Override
public long[] sort(List<Type> types, List<Page> pages, List<Integer> sortChannels, List<SortOrder> sortOrders, int expectedPositions) {
PagesIndex pagesIndex = pagesIndexFactory.newPagesIndex(types, expectedPositions);
pages.forEach(pagesIndex::addPage);
pagesIndex.sort(sortChannels, sortOrders);
return pagesIndex.getValueAddresses().toLongArray(null);
}
use of io.prestosql.operator.PagesIndex in project hetu-core by openlookeng.
the class PagesSortBenchmark method runPagesIndexSortBenchmark.
@Benchmark
public List<Page> runPagesIndexSortBenchmark(PagesIndexSortBenchmarkData data) {
PagesIndex.TestingFactory pagesIndexFactory = new PagesIndex.TestingFactory(false);
PagesIndex pageIndex = pagesIndexFactory.newPagesIndex(data.getTypes(), data.getTotalPositions());
for (Page page : data.getPages()) {
pageIndex.addPage(page);
}
pageIndex.sort(data.getSortChannels(), data.getSortOrders());
return Streams.stream(pageIndex.getSortedPages()).collect(toImmutableList());
}
Aggregations