Package com.facebook.presto.spi.block

Examples of com.facebook.presto.spi.block.BlockBuilderStatus


        extends AbstractTestAggregationFunction
{
    @Override
    public Block getSequenceBlock(int start, int length)
    {
        BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            DOUBLE.writeDouble(blockBuilder, (double) i);
        }
        return blockBuilder.build();
    }
View Full Code Here


        return new Page(valuesBlock, weightsBlock, percentilesBlock);
    }

    private static RunLengthEncodedBlock createRLEBlock(double percentile, int positionCount)
    {
        BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());
        DOUBLE.writeDouble(blockBuilder, percentile);
        return new RunLengthEncodedBlock(blockBuilder.build(), positionCount);
    }
View Full Code Here

        extends AbstractTestAggregationFunction
{
    @Override
    public Block getSequenceBlock(int start, int length)
    {
        BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            DOUBLE.writeDouble(blockBuilder, (double) i);
        }
        return blockBuilder.build();
    }
View Full Code Here

        extends AbstractTestAggregationFunction
{
    @Override
    public Block getSequenceBlock(int start, int length)
    {
        BlockBuilder blockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            BIGINT.writeLong(blockBuilder, i);
        }
        return blockBuilder.build();
    }
View Full Code Here

        extends AbstractTestAggregationFunction
{
    @Override
    public Block getSequenceBlock(int start, int length)
    {
        BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            DOUBLE.writeDouble(blockBuilder, (double) i);
        }
        return blockBuilder.build();
    }
View Full Code Here

    }

    @Override
    public Block getSequenceBlock(int start, int length)
    {
        BlockBuilder blockBuilder = getType().createBlockBuilder(new BlockBuilderStatus());
        for (int i = start; i < start + length; i++) {
            if (getType() == BIGINT) {
                BIGINT.writeLong(blockBuilder, (long) i);
            }
            else {
View Full Code Here

                if (rand.nextDouble() < sampleRatio) {
                    sampledList.add(x);
                }
            }

            BlockBuilder builder = getType().createBlockBuilder(new BlockBuilderStatus());
            for (Number sample : sampledList.build()) {
                if (getType() == BIGINT) {
                    BIGINT.writeLong(builder, sample.longValue());
                }
                else if (getType() == DOUBLE) {
View Full Code Here

                model = new ClassifierFeatureTransformer(new SvmClassifier(params), new FeatureUnitNormalizer());
            }

            model.train(dataset);

            BlockBuilder builder = getFinalType().createBlockBuilder(new BlockBuilderStatus());
            getFinalType().writeSlice(builder, ModelUtils.serialize(model));

            return builder.build();
        }
View Full Code Here

                model = new ClassifierFeatureTransformer(new SvmClassifier(), new FeatureUnitNormalizer());
            }

            model.train(dataset);

            BlockBuilder builder = getFinalType().createBlockBuilder(new BlockBuilderStatus());
            getFinalType().writeSlice(builder, ModelUtils.serialize(model));

            return builder.build();
        }
View Full Code Here

public class TestPagesSerde
{
    @Test
    public void testRoundTrip()
    {
        BlockBuilder expectedBlockBuilder = VARCHAR.createBlockBuilder(new BlockBuilderStatus());
        VARCHAR.writeString(expectedBlockBuilder, "alice");
        VARCHAR.writeString(expectedBlockBuilder, "bob");
        VARCHAR.writeString(expectedBlockBuilder, "charlie");
        VARCHAR.writeString(expectedBlockBuilder, "dave");
        Block expectedBlock = expectedBlockBuilder.build();
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.block.BlockBuilderStatus

Copyright © 2018 www.massapicom. 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.