Search in sources :

Example 1 with GroupByIdBlock

use of io.prestosql.operator.GroupByIdBlock in project hetu-core by openlookeng.

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(io.prestosql.operator.GroupByIdBlock)

Example 2 with GroupByIdBlock

use of io.prestosql.operator.GroupByIdBlock in project hetu-core by openlookeng.

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(io.prestosql.operator.GroupByIdBlock) Page(io.prestosql.spi.Page) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

GroupByIdBlock (io.prestosql.operator.GroupByIdBlock)2 Page (io.prestosql.spi.Page)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1