本文整理汇总了Java中com.facebook.presto.spi.block.BlockBuilder.writeObject方法的典型用法代码示例。如果您正苦于以下问题:Java BlockBuilder.writeObject方法的具体用法?Java BlockBuilder.writeObject怎么用?Java BlockBuilder.writeObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.presto.spi.block.BlockBuilder
的用法示例。
在下文中一共展示了BlockBuilder.writeObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: output
import com.facebook.presto.spi.block.BlockBuilder; //导入方法依赖的package包/类
@OutputFunction("map<double,double>")
public static void output(State state, BlockBuilder out)
{
if (state.get() == null) {
out.appendNull();
}
else {
Map<Double, Double> value = state.get().getBuckets();
BlockBuilder blockBuilder = DoubleType.DOUBLE.createBlockBuilder(new BlockBuilderStatus(), value.size() * 2);
for (Map.Entry<Double, Double> entry : value.entrySet()) {
DoubleType.DOUBLE.writeDouble(blockBuilder, entry.getKey());
DoubleType.DOUBLE.writeDouble(blockBuilder, entry.getValue());
}
Block block = blockBuilder.build();
out.writeObject(block);
out.closeEntry();
}
}
示例2: output
import com.facebook.presto.spi.block.BlockBuilder; //导入方法依赖的package包/类
public static void output(KeyValuePairsState state, BlockBuilder out)
{
KeyValuePairs pairs = state.get();
if (pairs == null) {
out.appendNull();
}
else {
Block block = pairs.toMultimapNativeEncoding();
out.writeObject(block);
out.closeEntry();
}
}
示例3: output
import com.facebook.presto.spi.block.BlockBuilder; //导入方法依赖的package包/类
public static void output(KeyValuePairsState state, BlockBuilder out)
{
KeyValuePairs pairs = state.get();
if (pairs == null) {
out.appendNull();
}
else {
Block block = pairs.toMapNativeEncoding();
out.writeObject(block);
out.closeEntry();
}
}
示例4: appendTo
import com.facebook.presto.spi.block.BlockBuilder; //导入方法依赖的package包/类
@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
if (block.isNull(position)) {
blockBuilder.appendNull();
}
else {
blockBuilder.writeObject(block.getObject(position, Block.class));
blockBuilder.closeEntry();
}
}