Package com.facebook.presto.spi.block

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


        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


    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

    {
        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

                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

                pageBuilder.declarePosition();
                for (int column = 0; column < types.size(); column++) {
                    BlockBuilder output = pageBuilder.getBlockBuilder(column);
                    if (cursor.isNull(column)) {
                        output.appendNull();
                    }
                    else {
                        Type type = types.get(column);
                        Class<?> javaType = type.getJavaType();
                        if (javaType == boolean.class) {
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

    {
        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

    private static Block createBlock(Type type, Object value)
    {
        BlockBuilder blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());

        if (value == null) {
            blockBuilder.appendNull();
        }
        else if (type.getJavaType() == boolean.class) {
            blockBuilder.appendBoolean((Boolean) value);
        }
        else if (type.getJavaType() == 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.