Search in sources :

Example 1 with GroupByIdBlock

use of com.facebook.presto.operator.GroupByIdBlock in project presto by prestodb.

the class GroupByHashPageIndexer method indexPage.

@Override
public int[] indexPage(Page page) {
    Work<GroupByIdBlock> work = hash.getGroupIds(page);
    boolean done = work.process();
    // TODO: this class does not yield wrt memory limit; enable it
    verify(done);
    GroupByIdBlock groupIds = work.getResult();
    int[] indexes = new int[page.getPositionCount()];
    for (int i = 0; i < indexes.length; i++) {
        indexes[i] = toIntExact(groupIds.getGroupId(i));
    }
    return indexes;
}
Also used : GroupByIdBlock(com.facebook.presto.operator.GroupByIdBlock)

Example 2 with GroupByIdBlock

use of com.facebook.presto.operator.GroupByIdBlock in project presto by prestodb.

the class BenchmarkGroupedTypedHistogram method testSharedGroupWithLargeBlocksRunner.

@Benchmark
public GroupedAccumulator testSharedGroupWithLargeBlocksRunner(Data data) {
    GroupedAccumulator groupedAccumulator = data.groupedAccumulator;
    for (int i = 0; i < data.numGroups; i++) {
        GroupByIdBlock groupByIdBlock = data.groupByIdBlocks[i];
        Page page = data.pages[i];
        groupedAccumulator.addInput(groupByIdBlock, page);
    }
    return groupedAccumulator;
}
Also used : GroupByIdBlock(com.facebook.presto.operator.GroupByIdBlock) Page(com.facebook.presto.common.Page) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

GroupByIdBlock (com.facebook.presto.operator.GroupByIdBlock)2 Page (com.facebook.presto.common.Page)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1