public GetNonDictionaryGroupIdsWork(Page page) { this.page = requireNonNull(page, "page is null"); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(page.getPositionCount()); }
public GetGroupIdsWork(Block block) { this.block = requireNonNull(block, "block is null"); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(block.getPositionCount()); }
public GetGroupIdsWork(Block block) { this.block = requireNonNull(block, "block is null"); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(block.getPositionCount()); }
public GetNonDictionaryGroupIdsWork(Page page) { this.page = requireNonNull(page, "page is null"); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(page.getPositionCount()); }
private static Block buildSequenceBlock(long start, int count) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(count); for (int i = 0; i < count; i++) { BIGINT.writeLong(builder, start + i); } return builder.build(); }
public GetDictionaryGroupIdsWork(Page page) { this.page = requireNonNull(page, "page is null"); verify(canProcessDictionary(page), "invalid call to processDictionary"); this.dictionaryBlock = (DictionaryBlock) page.getBlock(channels[0]); updateDictionaryLookBack(dictionaryBlock.getDictionary()); this.dictionaryPage = createPageWithExtractedDictionary(page); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(page.getPositionCount()); }
public static Block createEmptyLongsBlock() { return BIGINT.createFixedSizeBlockBuilder(0).build(); }
public GetDictionaryGroupIdsWork(Page page) { this.page = requireNonNull(page, "page is null"); verify(canProcessDictionary(page), "invalid call to processDictionary"); this.dictionaryBlock = (DictionaryBlock) page.getBlock(channels[0]); updateDictionaryLookBack(dictionaryBlock.getDictionary()); this.dictionaryPage = createPageWithExtractedDictionary(page); // we know the exact size required for the block this.blockBuilder = BIGINT.createFixedSizeBlockBuilder(page.getPositionCount()); }
public static Block createLongSequenceBlock(int start, int end) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(end - start); for (int i = start; i < end; i++) { BIGINT.writeLong(builder, i); } return builder.build(); }
public static Block createLongSequenceBlock(int start, int end) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(end - start); for (int i = start; i < end; i++) { BIGINT.writeLong(builder, i); } return builder.build(); }
public static Block createLongRepeatBlock(int value, int length) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(length); for (int i = 0; i < length; i++) { BIGINT.writeLong(builder, value); } return builder.build(); }
public static Block createLongRepeatBlock(int value, int length) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(length); for (int i = 0; i < length; i++) { BIGINT.writeLong(builder, value); } return builder.build(); }
@Test public void testBinaryMergeIteratorOverEmptyPage() { Page emptyPage = new Page(0, BIGINT.createFixedSizeBlockBuilder(0).build()); WorkProcessor<Page> mergedPage = new MergeHashSort(newSimpleAggregatedMemoryContext()).merge( ImmutableList.of(BIGINT), ImmutableList.of(BIGINT), ImmutableList.of(ImmutableList.of(emptyPage).iterator()).stream() .map(WorkProcessor::fromIterator) .collect(toImmutableList()), new DriverYieldSignal()); assertFinishes(mergedPage); }
@Test public void testBinaryMergeIteratorOverEmptyPage() { Page emptyPage = new Page(0, BIGINT.createFixedSizeBlockBuilder(0).build()); WorkProcessor<Page> mergedPage = new MergeHashSort(newSimpleAggregatedMemoryContext()).merge( ImmutableList.of(BIGINT), ImmutableList.of(BIGINT), ImmutableList.of(ImmutableList.of(emptyPage).iterator()).stream() .map(WorkProcessor::fromIterator) .collect(toImmutableList()), new DriverYieldSignal()); assertFinishes(mergedPage); }
private Block generateIdColumn() { BlockBuilder block = BIGINT.createFixedSizeBlockBuilder(inputPage.getPositionCount()); for (int currentPosition = 0; currentPosition < inputPage.getPositionCount(); currentPosition++) { if (rowIdCounter >= maxRowIdCounterValue) { requestValues(); } long rowId = rowIdCounter++; verify((rowId & uniqueValueMask) == 0, "RowId and uniqueValue mask overlaps"); BIGINT.writeLong(block, uniqueValueMask | rowId); } return block.build(); } }
private Block createRowNumberBlock() { BlockBuilder rowNumberBlock = BIGINT.createFixedSizeBlockBuilder(inputPage.getPositionCount()); for (int currentPosition = 0; currentPosition < inputPage.getPositionCount(); currentPosition++) { long partitionId = getPartitionId(currentPosition); long nextRowCount = partitionRowCount.get(partitionId) + 1; BIGINT.writeLong(rowNumberBlock, nextRowCount); partitionRowCount.set(partitionId, nextRowCount); } return rowNumberBlock.build(); }
private static Page createLongBlockPage(long... values) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(values.length); for (long value : values) { BIGINT.writeLong(builder, value); } return new Page(builder.build()); } }
private static Page createLongBlockPage(long... values) { BlockBuilder builder = BIGINT.createFixedSizeBlockBuilder(values.length); for (long value : values) { BIGINT.writeLong(builder, value); } return new Page(builder.build()); } }
private static Page createPage() { BlockBuilder blockBuilder = BIGINT.createFixedSizeBlockBuilder(POSITIONS_PER_PAGE); BIGINT.writeLong(blockBuilder, 42L); return new Page(0, blockBuilder.build()); }
private Block createRowNumberBlock() { BlockBuilder rowNumberBlock = BIGINT.createFixedSizeBlockBuilder(inputPage.getPositionCount()); for (int currentPosition = 0; currentPosition < inputPage.getPositionCount(); currentPosition++) { long partitionId = getPartitionId(currentPosition); long nextRowCount = partitionRowCount.get(partitionId) + 1; BIGINT.writeLong(rowNumberBlock, nextRowCount); partitionRowCount.set(partitionId, nextRowCount); } return rowNumberBlock.build(); }