Package com.facebook.presto.spi.block

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


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


        public final Block evaluateIntermediate()
        {
            BlockBuilder out = getIntermediateType().createBlockBuilder(new BlockBuilderStatus());

            if (digest.getCount() == 0.0) {
                out.appendNull();
            }
            else {
                DynamicSliceOutput sliceOutput = new DynamicSliceOutput(digest.estimatedSerializedSizeInBytes() + SIZE_OF_DOUBLE);
                // write digest
                digest.serialize(sliceOutput);
View Full Code Here

        public final Block evaluateIntermediate()
        {
            BlockBuilder out = getIntermediateType().createBlockBuilder(new BlockBuilderStatus());

            if (digest.getCount() == 0.0) {
                out.appendNull();
            }
            else {
                DynamicSliceOutput sliceOutput = new DynamicSliceOutput(digest.estimatedSerializedSizeInBytes() + SIZE_OF_DOUBLE);
                // write digest
                digest.serialize(sliceOutput);
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 {
                    blockBuilder.appendBoolean(contains);
                }
            }
View Full Code Here

                }

                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

    {
        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

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.