Package com.facebook.presto.spi.block

Examples of com.facebook.presto.spi.block.BlockBuilderStatus


    }

    @Test
    public void testBigintSerializedSize()
    {
        BlockBuilder builder = BIGINT.createBlockBuilder(new BlockBuilderStatus());

        // empty page
        Page page = new Page(builder.build());
        int pageSize = serializedSize(ImmutableList.of(BIGINT), page);
        assertEquals(pageSize, 35); // page overhead
View Full Code Here


    }

    @Test
    public void testVarcharSerializedSize()
    {
        BlockBuilder builder = VARCHAR.createBlockBuilder(new BlockBuilderStatus());

        // empty page
        Page page = new Page(builder.build());
        int pageSize = serializedSize(ImmutableList.of(VARCHAR), page);
        assertEquals(pageSize, 34); // page overhead
View Full Code Here

        }

        @Override
        public Block evaluateIntermediate()
        {
            BlockBuilder out = getIntermediateType().createBlockBuilder(new BlockBuilderStatus());
            return getBlock(out);
        }
View Full Code Here

        }

        @Override
        public Block evaluateFinal()
        {
            BlockBuilder out = getFinalType().createBlockBuilder(new BlockBuilderStatus());
            return getBlock(out);
        }
View Full Code Here

    {
        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            blockBuilder = block.getType().createBlockBuilder(new BlockBuilderStatus());
            encoding = blockBuilder.getEncoding();
        }
        for (int position = 0; position < block.getPositionCount(); position++) {
            block.appendTo(position, blockBuilder);
            if (blockBuilder.isFull()) {
View Full Code Here

    private void writeBlock()
    {
        Block block = blockBuilder.build();
        encoding.writeBlock(sliceOutput, block);
        blockBuilder = block.getType().createBlockBuilder(new BlockBuilderStatus());
    }
View Full Code Here

        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (encoding == null) {
            encoding = new SnappyBlockEncoding(block.getType(), block.getEncoding());
            blockBuilder = block.getType().createBlockBuilder(new BlockBuilderStatus());
        }
        for (int position = 0; position < block.getPositionCount(); position++) {
            block.appendTo(position, blockBuilder);
            if (blockBuilder.isFull()) {
                flushBlock();
View Full Code Here

    private void flushBlock()
    {
        SnappyBlock snappyBlock = new SnappyBlock(blockBuilder.build());
        encoding.writeBlock(sliceOutput, snappyBlock);
        blockBuilder = snappyBlock.getType().createBlockBuilder(new BlockBuilderStatus());
    }
View Full Code Here

        if (type == null) {
            type = block.getType();
            dictionaryBuilder = new GroupByHash(ImmutableList.of(type), new int[] {0}, 1_000);
        }

        BlockBuilder idBlockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int position = 0; position < block.getPositionCount(); position++) {
            int key = dictionaryBuilder.putIfAbsent(position, block);
            idBlockBuilder.appendLong(key);
        }
        idWriter.append(idBlockBuilder.build());
View Full Code Here

    {
        checkState(type != null, "nothing appended");
        checkState(!finished, "already finished");
        finished = true;

        BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());
        for (int groupId = 0; groupId < dictionaryBuilder.getGroupCount(); groupId++) {
            dictionaryBuilder.appendValuesTo(groupId, blockBuilder);
        }
        return new DictionaryBlockEncoding(blockBuilder.build(), idWriter.finish());
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.block.BlockBuilderStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.