本文整理了Java中com.facebook.presto.spi.block.Block.getShort()
方法的一些代码示例,展示了Block.getShort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getShort()
方法的具体详情如下:
包路径:com.facebook.presto.spi.block.Block
类名称:Block
方法名:getShort
[英]Gets a little endian short at offset in the value at position.
[中]在位置处的值的偏移处获取一个小的endian短值。
代码示例来源:origin: prestodb/presto
@Override
public long getLong(Block block, int position)
{
return (long) block.getShort(position, 0);
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
return block.getShort(position, offset);
}
代码示例来源:origin: prestodb/presto
@Override
public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
int leftValue = leftBlock.getShort(leftPosition, 0);
int rightValue = rightBlock.getShort(rightPosition, 0);
return leftValue == rightValue;
}
代码示例来源:origin: prestodb/presto
@Override
public int compareTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
// WARNING: the correctness of InCodeGenerator is dependent on the implementation of this
// function being the equivalence of internal long representation.
short leftValue = leftBlock.getShort(leftPosition, 0);
short rightValue = rightBlock.getShort(rightPosition, 0);
return Short.compare(leftValue, rightValue);
}
代码示例来源:origin: prestodb/presto
@Override
public Object getObjectValue(ConnectorSession session, Block block, int position)
{
if (block.isNull(position)) {
return null;
}
return block.getShort(position, 0);
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
return dictionary.getShort(getId(position), offset);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return hash(block.getShort(position, 0));
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
assureLoaded();
return block.getShort(position, offset);
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
checkReadablePosition(position);
return value.getShort(0, offset);
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
position = getAbsolutePosition(position);
if (position % 2 == 0) {
return getRawKeyBlock().getShort(position / 2, offset);
}
else {
return getRawValueBlock().getShort(position / 2, offset);
}
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
checkFieldIndex(position);
return getRawFieldBlock(position).getShort(rowIndex, offset);
}
代码示例来源:origin: prestodb/presto
@Override
public short getShort(int position, int offset)
{
checkReadablePosition(position);
return getBlock().getShort(position + start, offset);
}
代码示例来源:origin: prestodb/presto
@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
if (block.isNull(position)) {
blockBuilder.appendNull();
}
else {
blockBuilder.writeShort(block.getShort(position, 0)).closeEntry();
}
}
代码示例来源:origin: prestodb/presto
@Override
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block)
{
int positionCount = block.getPositionCount();
sliceOutput.appendInt(positionCount);
encodeNullsAsBits(sliceOutput, block);
for (int position = 0; position < positionCount; position++) {
if (!block.isNull(position)) {
sliceOutput.writeShort(block.getShort(position, 0));
}
}
}
代码示例来源:origin: prestodb/presto
assertEquals(block.getShort(position, offset), expectedSliceValue.getShort(offset));
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
int leftValue = leftBlock.getShort(leftPosition, 0);
int rightValue = rightBlock.getShort(rightPosition, 0);
return leftValue == rightValue;
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public long getLong(Block block, int position)
{
return (long) block.getShort(position, 0);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public short getShort(int position, int offset)
{
assureLoaded();
return block.getShort(position, offset);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public short getShort(int position, int offset)
{
return dictionary.getShort(getId(position), offset);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public short getShort(int position, int offset)
{
checkReadablePosition(position);
return value.getShort(0, offset);
}
内容来源于网络,如有侵权,请联系作者删除!