use of io.trino.spi.block.IntArrayBlockBuilder in project trino by trinodb.
the class HivePageSink method buildBucketBlock.
private Block buildBucketBlock(Page page) {
if (bucketFunction == null) {
return null;
}
IntArrayBlockBuilder bucketColumnBuilder = new IntArrayBlockBuilder(null, page.getPositionCount());
Page bucketColumnsPage = extractColumns(page, bucketColumns);
for (int position = 0; position < page.getPositionCount(); position++) {
int bucket = bucketFunction.getBucket(bucketColumnsPage, position);
bucketColumnBuilder.writeInt(bucket);
}
return bucketColumnBuilder.build();
}
Aggregations