Search in sources :

Example 1 with AbstractMapBlock

use of com.facebook.presto.common.block.AbstractMapBlock in project presto by prestodb.

the class TestMapBlock method verifyMapRegion.

private void verifyMapRegion(Map<String, Long>[] testValues, AbstractMapBlock block, BlockBuilder blockBuilder, int offset, int length) {
    boolean isHashTablePresent = block.isHashTablesPresent();
    MapBlock region = (MapBlock) block.getRegion(offset, length);
    assertEquals(region.isHashTablesPresent(), isHashTablePresent);
    assertBlock(region, () -> blockBuilder.newBlockBuilderLike(null), Arrays.copyOfRange(testValues, offset, offset + length));
    assertTrue(region.isHashTablesPresent());
}
Also used : AbstractMapBlock(com.facebook.presto.common.block.AbstractMapBlock) MapBlock(com.facebook.presto.common.block.MapBlock) SingleMapBlock(com.facebook.presto.common.block.SingleMapBlock)

Aggregations

AbstractMapBlock (com.facebook.presto.common.block.AbstractMapBlock)1 MapBlock (com.facebook.presto.common.block.MapBlock)1 SingleMapBlock (com.facebook.presto.common.block.SingleMapBlock)1