use of io.prestosql.spi.block.BlockBuilder in project hetu-core by openlookeng.
the class TestIntervalYearMonthType method createTestBlock.
public static Block createTestBlock() {
BlockBuilder blockBuilder = INTERVAL_YEAR_MONTH.createBlockBuilder(null, 15);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 1111);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 1111);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 1111);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 2222);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 2222);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 2222);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 2222);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 2222);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 3333);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 3333);
INTERVAL_YEAR_MONTH.writeLong(blockBuilder, 4444);
return blockBuilder.build();
}
use of io.prestosql.spi.block.BlockBuilder in project hetu-core by openlookeng.
the class TestIpAddressOperators method hashFromType.
private static long hashFromType(String address) {
BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 1);
IPADDRESS.writeSlice(blockBuilder, Slices.wrappedBuffer(InetAddresses.forString(address).getAddress()));
Block block = blockBuilder.build();
return IPADDRESS.hash(block, 0);
}
use of io.prestosql.spi.block.BlockBuilder in project hetu-core by openlookeng.
the class TestIpAddressType method createTestBlock.
public static Block createTestBlock() {
BlockBuilder blockBuilder = IPADDRESS.createBlockBuilder(null, 1);
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8320"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8321"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8322"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8323"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8324"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8325"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8326"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8327"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8328"));
IPADDRESS.writeSlice(blockBuilder, getSliceForAddress("2001:db8::ff00:42:8329"));
return blockBuilder.build();
}
use of io.prestosql.spi.block.BlockBuilder in project hetu-core by openlookeng.
the class TestTinyintArrayType method createTestBlock.
public static Block createTestBlock(Type arrayType) {
BlockBuilder blockBuilder = arrayType.createBlockBuilder(null, 4);
arrayType.writeObject(blockBuilder, arrayBlockOf(TINYINT, 1, 2));
arrayType.writeObject(blockBuilder, arrayBlockOf(TINYINT, 1, 2, 3));
arrayType.writeObject(blockBuilder, arrayBlockOf(TINYINT, 1, 2, 3));
arrayType.writeObject(blockBuilder, arrayBlockOf(TINYINT, 100, 110, 127));
return blockBuilder.build();
}
use of io.prestosql.spi.block.BlockBuilder in project hetu-core by openlookeng.
the class TestTinyintVarcharMapType method createTestBlock.
public static Block createTestBlock(Type mapType) {
BlockBuilder blockBuilder = mapType.createBlockBuilder(null, 2);
mapType.writeObject(blockBuilder, mapBlockOf(TINYINT, VARCHAR, ImmutableMap.of(1, "hi")));
mapType.writeObject(blockBuilder, mapBlockOf(TINYINT, VARCHAR, ImmutableMap.of(1, "2", 2, "hello")));
return blockBuilder.build();
}
Aggregations