Package com.facebook.presto.spi.block

Examples of com.facebook.presto.spi.block.BlockBuilder.appendNull()


        BlockBuilder builder = builders.get(channel);

        Type type = types.get(channel);
        Class<?> javaType = type.getJavaType();
        if (value == null) {
            builder.appendNull();
        }
        else if (javaType == boolean.class) {
            type.writeBoolean(builder, (Boolean) value);
        }
        else if (javaType == long.class) {
View Full Code Here


    private Block createAlternatingNullsBlock(Block testBlock)
    {
        BlockBuilder nullsBlockBuilder = type.createBlockBuilder(new BlockBuilderStatus());
        for (int position = 0; position < testBlock.getPositionCount(); position++) {
            if (type.getJavaType() == void.class) {
                nullsBlockBuilder.appendNull();
            }
            else if (type.getJavaType() == boolean.class) {
                type.writeBoolean(nullsBlockBuilder, type.getBoolean(testBlock, position));
            }
            else if (type.getJavaType() == long.class) {
View Full Code Here

                type.writeSlice(nullsBlockBuilder, slice, 0, slice.length());
            }
            else {
                throw new RuntimeException("Unsupported Java type " + type.getJavaType());
            }
            nullsBlockBuilder.appendNull();
        }
        return nullsBlockBuilder.build();
    }

    @Test
View Full Code Here

    {
        BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());

        Class<?> javaType = type.getJavaType();
        if (value == null) {
            blockBuilder.appendNull();
        }
        else if (javaType == boolean.class) {
            type.writeBoolean(blockBuilder, (Boolean) value);
        }
        else if (javaType == long.class) {
View Full Code Here

    private Block toBlock(Object value)
    {
        BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());
        Class<?> javaType = type.getJavaType();
        if (value == null) {
            blockBuilder.appendNull();
        }
        else if (javaType == boolean.class) {
            type.writeBoolean(blockBuilder, (Boolean) value);
        }
        else if (javaType == long.class) {
View Full Code Here

    {
        BlockBuilder builder = VARCHAR.createBlockBuilder(new BlockBuilderStatus());

        for (String value : values) {
            if (value == null) {
                builder.appendNull();
            }
            else {
                VARCHAR.writeString(builder, value);
            }
        }
View Full Code Here

    {
        BlockBuilder builder = BOOLEAN.createBlockBuilder(new BlockBuilderStatus());

        for (Boolean value : values) {
            if (value == null) {
                builder.appendNull();
            }
            else {
                BOOLEAN.writeBoolean(builder, value);
            }
        }
View Full Code Here

    {
        BlockBuilder builder = BIGINT.createBlockBuilder(new BlockBuilderStatus());

        for (Long value : values) {
            if (value == null) {
                builder.appendNull();
            }
            else {
                BIGINT.writeLong(builder, value);
            }
        }
View Full Code Here

    {
        BlockBuilder builder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());

        for (Double value : values) {
            if (value == null) {
                builder.appendNull();
            }
            else {
                DOUBLE.writeDouble(builder, value);
            }
        }
View Full Code Here

        BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());

        for (Object value : values) {
            Class<?> javaType = type.getJavaType();
            if (value == null) {
                blockBuilder.appendNull();
            }
            else if (javaType == boolean.class) {
                type.writeBoolean(blockBuilder, (Boolean) value);
            }
            else if (javaType == long.class) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.