use of io.trino.spi.block.Block in project trino by trinodb.
the class SimplePageWithPositionEqualsAndHash method hashCode.
@Override
public long hashCode(Page page, int position) {
long hashCode = 0;
for (int i = 0; i < equalityChannels.size(); i++) {
int equalityChannel = equalityChannels.getInt(i);
Block block = page.getBlock(equalityChannel);
hashCode = 31 * hashCode + hashOperators.get(i).hashCodeNullSafe(block, position);
}
return hashCode;
}
use of io.trino.spi.block.Block in project trino by trinodb.
the class SimplePageWithPositionEqualsAndHash method equals.
@Override
public boolean equals(Page left, int leftPosition, Page right, int rightPosition) {
for (int i = 0; i < equalityChannels.size(); i++) {
int equalityChannel = equalityChannels.getInt(i);
Block leftBlock = left.getBlock(equalityChannel);
Block rightBlock = right.getBlock(equalityChannel);
if (distinctFromOperators.get(i).isDistinctFrom(leftBlock, leftPosition, rightBlock, rightPosition)) {
return false;
}
}
return true;
}
use of io.trino.spi.block.Block in project trino by trinodb.
the class PagesIndex method getObject.
public Object getObject(int channel, int position) {
long pageAddress = valueAddresses.getLong(position);
Block block = channels[channel].get(decodeSliceIndex(pageAddress));
int blockPosition = decodePosition(pageAddress);
return types.get(channel).getObject(block, blockPosition);
}
use of io.trino.spi.block.Block in project trino by trinodb.
the class PagesIndex method isNull.
public boolean isNull(int channel, int position) {
long pageAddress = valueAddresses.getLong(position);
Block block = channels[channel].get(decodeSliceIndex(pageAddress));
int blockPosition = decodePosition(pageAddress);
return block.isNull(blockPosition);
}
use of io.trino.spi.block.Block in project trino by trinodb.
the class PagesIndex method getSingleValueBlock.
public Block getSingleValueBlock(int channel, int position) {
long pageAddress = valueAddresses.getLong(position);
Block block = channels[channel].get(decodeSliceIndex(pageAddress));
int blockPosition = decodePosition(pageAddress);
return block.getSingleValueBlock(blockPosition);
}
Aggregations