Package com.facebook.presto.spi.block

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


        {
            BlockBuilder out = getFinalType().createBlockBuilder(new BlockBuilderStatus());

            out.appendLong(count);

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


                Slice slice = sliceOutput.slice();
                out.appendSlice(slice);
            }

            return out.build();
        }

        @Override
        public final Block evaluateFinal()
        {
View Full Code Here

        {
            BlockBuilder out = getFinalType().createBlockBuilder(new BlockBuilderStatus());

            evaluate(out, parameterType, digest, percentile);

            return out.build();
        }
    }

    private static Type getOutputType(Type parameterType)
    {
View Full Code Here

        @Override
        public Block evaluateIntermediate()
        {
            BlockBuilder out = intermediateType.createBlockBuilder(new BlockBuilderStatus());
            getStateSerializer().serialize(state, out);
            return out.build();
        }

        @Override
        public Block evaluateFinal()
        {
View Full Code Here

        @Override
        public Block evaluateFinal()
        {
            BlockBuilder out = finalType.createBlockBuilder(new BlockBuilderStatus());
            AbstractAggregationFunction.this.evaluateFinal(state, confidence, out);
            return out.build();
        }

        @Override
        public long getEstimatedSize()
        {
View Full Code Here

        // add the new boolean column to the page
        Block[] sourceBlocks = page.getBlocks();
        Block[] outputBlocks = new Block[sourceBlocks.length + 1]; // +1 for the single boolean output channel

        System.arraycopy(sourceBlocks, 0, outputBlocks, 0, sourceBlocks.length);
        outputBlocks[sourceBlocks.length] = blockBuilder.build();

        outputPage = new Page(outputBlocks);
    }

    @Override
View Full Code Here

        if (remainingLimit >= 0 && rowsToCopy == page.getPositionCount()) {
            nextPage = page;
        }
        else {
            Block[] blocks = new Block[page.getChannelCount()];
            blocks[sampleWeightChannel] = builder.build();
            for (int channel = 0; channel < page.getChannelCount(); channel++) {
                if (channel == sampleWeightChannel) {
                    continue;
                }
                Block block = page.getBlock(channel);
View Full Code Here

            // output the group id for this row
            blockBuilder.appendLong(groupId);
        }

        Block block = blockBuilder.build();
        return new GroupByIdBlock(nextGroupId, block);
    }

    public int putIfAbsent(int position, Block... blocks)
    {
View Full Code Here

    public void testHashBuilderResize()
    {
        BlockBuilder builder = VARCHAR.createBlockBuilder(new BlockBuilderStatus());
        builder.appendSlice(Slices.allocate(200_000)); // this must be larger than DEFAULT_MAX_BLOCK_SIZE, 64K
        builder.build();

        List<Page> input = rowPagesBuilder(VARCHAR)
                .addSequencePage(10, 100)
                .addBlocksPage(builder.build())
                .addSequencePage(10, 100)
View Full Code Here

        builder.appendSlice(Slices.allocate(200_000)); // this must be larger than DEFAULT_MAX_BLOCK_SIZE, 64K
        builder.build();

        List<Page> input = rowPagesBuilder(VARCHAR)
                .addSequencePage(10, 100)
                .addBlocksPage(builder.build())
                .addSequencePage(10, 100)
                .build();

        ConnectorSession session = new ConnectorSession("user", "source", "catalog", "schema", UTC_KEY, Locale.ENGLISH, "address", "agent");
        DriverContext driverContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session, new DataSize(3, Unit.MEGABYTE))
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.