Package com.facebook.presto.spi.block

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


        BlockBuilder blockBuilder = BOOLEAN.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            // true, false, true, false...
            BOOLEAN.writeBoolean(blockBuilder, i % 2 == 0);
        }
        return blockBuilder.build();
    }

    @Override
    public Boolean getExpectedValue(int start, int length)
    {
View Full Code Here


    {
        BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            DOUBLE.writeDouble(blockBuilder, (double) i);
        }
        return blockBuilder.build();
    }

    @Override
    public Number getExpectedValue(int start, int length)
    {
View Full Code Here

        BlockBuilder blockBuilder = BOOLEAN.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            // false, true, false, true...
            BOOLEAN.writeBoolean(blockBuilder, i % 2 != 0);
        }
        return blockBuilder.build();
    }

    @Override
    public Boolean getExpectedValue(int start, int length)
    {
View Full Code Here

            int rowNumberChannel = page.getChannelCount() - 1;
            for (int i = 0; i < page.getPositionCount(); i++) {
                BIGINT.writeLong(builder, BIGINT.getLong(page.getBlock(rowNumberChannel), i));
            }
        }
        return builder.build();
    }

    private static List<Page> stripRowNumberColumn(List<Page> input)
    {
        return IterableTransformer.on(input).transform(new Function<Page, Page>()
View Full Code Here

    {
        BlockBuilder blockBuilder = VARBINARY.createBlockBuilder(new BlockBuilderStatus());
        for (int i = 0; i < length; i++) {
            VARBINARY.writeSlice(blockBuilder, Slices.wrappedBuffer(Ints.toByteArray(i)));
        }
        return blockBuilder.build();
    }

    @Override
    public Object getExpectedValue(int start, int length)
    {
View Full Code Here

                for (int i = 0; i < page.getPositionCount(); i++) {
                    BIGINT.writeLong(builder, sampleWeight);
                }
                Block[] blocks = new Block[page.getChannelCount() + 1];
                System.arraycopy(page.getBlocks(), 0, blocks, 0, page.getChannelCount());
                blocks[blocks.length - 1] = builder.build();
                return new Page(blocks);
            }
        }).list();
    }
View Full Code Here

            else {
                throw new UnsupportedOperationException("not yet implemented: " + javaType);
            }
        }

        return blockBuilder.build();
    }

    private List<Object> createRandomSample(int uniques, int total)
    {
        Preconditions.checkArgument(uniques <= total, "uniques (%s) must be <= total (%s)", uniques, total);
View Full Code Here

    {
        BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            BIGINT.writeLong(blockBuilder, i);
        }
        return blockBuilder.build();
    }

    @Override
    public Number getExpectedValue(int start, int length)
    {
View Full Code Here

    {
        BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            BIGINT.writeLong(blockBuilder, i);
        }
        return blockBuilder.build();
    }

    @Override
    public Number getExpectedValue(int start, int length)
    {
View Full Code Here

    {
        BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            BIGINT.writeLong(blockBuilder, i);
        }
        return blockBuilder.build();
    }

    @Override
    public Number getExpectedValue(int start, int length)
    {
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.