use of io.prestosql.spi.block.SingleRowBlockWriter in project hetu-core by openlookeng.
the class TestSimpleRowType method getGreaterValue.
@Override
protected Object getGreaterValue(Object value) {
RowBlockBuilder blockBuilder = (RowBlockBuilder) TYPE.createBlockBuilder(null, 1);
SingleRowBlockWriter singleRowBlockWriter;
Block block = (Block) value;
singleRowBlockWriter = blockBuilder.beginBlockEntry();
BIGINT.writeLong(singleRowBlockWriter, block.getSingleValueBlock(0).getLong(0, 0) + 1);
VARCHAR.writeSlice(singleRowBlockWriter, block.getSingleValueBlock(1).getSlice(0, 0, 1));
blockBuilder.closeEntry();
return TYPE.getObject(blockBuilder.build(), 0);
}
use of io.prestosql.spi.block.SingleRowBlockWriter in project hetu-core by openlookeng.
the class TestSimpleRowType method createTestBlock.
private static Block createTestBlock() {
RowBlockBuilder blockBuilder = (RowBlockBuilder) TYPE.createBlockBuilder(null, 3);
SingleRowBlockWriter singleRowBlockWriter;
singleRowBlockWriter = blockBuilder.beginBlockEntry();
BIGINT.writeLong(singleRowBlockWriter, 1);
VARCHAR.writeSlice(singleRowBlockWriter, utf8Slice("cat"));
blockBuilder.closeEntry();
singleRowBlockWriter = blockBuilder.beginBlockEntry();
BIGINT.writeLong(singleRowBlockWriter, 2);
VARCHAR.writeSlice(singleRowBlockWriter, utf8Slice("cats"));
blockBuilder.closeEntry();
singleRowBlockWriter = blockBuilder.beginBlockEntry();
BIGINT.writeLong(singleRowBlockWriter, 3);
VARCHAR.writeSlice(singleRowBlockWriter, utf8Slice("dog"));
blockBuilder.closeEntry();
return blockBuilder.build();
}
Aggregations