Search in sources :

Example 1 with MapBlock

use of io.prestosql.spi.block.MapBlock in project hetu-core by openlookeng.

the class MapType method hash.

@Override
public long hash(Block block, int position) {
    Block mapBlock = getObject(block, position);
    long result = 0;
    for (int i = 0; i < mapBlock.getPositionCount(); i += 2) {
        result += hashPosition(keyType, mapBlock, i) ^ hashPosition(valueType, mapBlock, i + 1);
    }
    return result;
}
Also used : MapBlock(io.prestosql.spi.block.MapBlock) SingleMapBlock(io.prestosql.spi.block.SingleMapBlock) Block(io.prestosql.spi.block.Block)

Aggregations

Block (io.prestosql.spi.block.Block)1 MapBlock (io.prestosql.spi.block.MapBlock)1 SingleMapBlock (io.prestosql.spi.block.SingleMapBlock)1