Package com.facebook.presto.spi.block

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


    public Block createAlternatingNullsBlock(Block sequenceBlock)
    {
        BlockBuilder blockBuilder = sequenceBlock.getType().createBlockBuilder(new BlockBuilderStatus());
        for (int position = 0; position < sequenceBlock.getPositionCount(); position++) {
            // append null
            blockBuilder.appendNull();
            // append value
            sequenceBlock.appendTo(position, blockBuilder);
        }
        return blockBuilder.build();
    }
View Full Code Here


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

        for (String value : values) {
            if (value == null) {
                builder.appendNull();
            }
            else {
                builder.appendSlice(Slices.utf8Slice(value));
            }
        }
View Full Code Here

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

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

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

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

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

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

    {
        BlockBuilder blockBuilder = sequenceBlock.getType().createBlockBuilder(new BlockBuilderStatus());
        BlockCursor cursor = sequenceBlock.cursor();
        while (cursor.advanceNextPosition()) {
            // append null
            blockBuilder.appendNull();
            // append value
            cursor.appendTo(blockBuilder);
        }
        return blockBuilder.build();
    }
View Full Code Here

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

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

                pageBuilder.declarePosition();
                for (int column = 0; column < types.size(); column++) {
                    BlockBuilder output = pageBuilder.getBlockBuilder(column);
                    if (cursor.isNull(column)) {
                        output.appendNull();
                    }
                    else {
                        Type type = getTypes().get(column);
                        Class<?> javaType = type.getJavaType();
                        if (javaType == boolean.class) {
View Full Code Here

        Block probeJoinBlock = page.getBlock(probeJoinChannel);

        // update hashing strategy to use probe cursor
        for (int position = 0; position < page.getPositionCount(); position++) {
            if (probeJoinBlock.isNull(position)) {
                blockBuilder.appendNull();
            }
            else {
                boolean contains = channelSet.contains(position, probeJoinBlock);
                if (!contains && channelSet.containsNull()) {
                    blockBuilder.appendNull();
View Full Code Here

                blockBuilder.appendNull();
            }
            else {
                boolean contains = channelSet.contains(position, probeJoinBlock);
                if (!contains && channelSet.containsNull()) {
                    blockBuilder.appendNull();
                }
                else {
                    BOOLEAN.writeBoolean(blockBuilder, contains);
                }
            }
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.