Package com.facebook.presto.spi.block

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


        }

        @Override
        public void addInput(Page page)
        {
            Block values = page.getBlock(valueChannel);
            Block masks = maskChannel.transform(page.blockGetter()).orNull();
            Block sampleWeights = sampleWeightChannel.transform(page.blockGetter()).orNull();

            for (int position = 0; position < values.getPositionCount(); position++) {
                long sampleWeight = ApproximateUtils.computeSampleWeight(masks, sampleWeights, position);
                if (!values.isNull(position) && sampleWeight > 0) {
                    AbstractAggregationFunction.this.processInput(state, values, position, sampleWeight);
View Full Code Here


        @Override
        public void addInput(GroupByIdBlock groupIdsBlock, Page page)
        {
            counts.ensureCapacity(groupIdsBlock.getGroupCount());
            samples.ensureCapacity(groupIdsBlock.getGroupCount());
            Block masks = null;
            if (maskChannel.isPresent()) {
                masks = page.getBlock(maskChannel.get());
            }
            Block sampleWeights = page.getBlock(sampleWeightChannel);

            for (int position = 0; position < groupIdsBlock.getPositionCount(); position++) {
                long groupId = groupIdsBlock.getGroupId(position);
                long weight = ApproximateUtils.computeSampleWeight(masks, sampleWeights, position);
                counts.add(groupId, weight);
View Full Code Here

    {
        positionCount += page.getPositionCount();

        int pageIndex = channels[0].size();
        for (int i = 0; i < channels.length; i++) {
            Block block = page.getBlock(i);
            channels[i].add(block);
            pagesMemorySize += block.getSizeInBytes();
        }

        for (int position = 0; position < page.getPositionCount(); position++) {
            long sliceAddress = encodeSyntheticAddress(pageIndex, position);
            valueAddresses.add(sliceAddress);
View Full Code Here

            int blockPosition = decodePosition(pageAddress);

            // append the row
            for (int i = 0; i < outputChannels.length; i++) {
                int outputChannel = outputChannels[i];
                Block block = this.channels[outputChannel].get(blockIndex);
                block.appendTo(blockPosition, pageBuilder.getBlockBuilder(i));
            }

            position++;
        }
View Full Code Here

    public void appendTo(int channel, int position, BlockBuilder output)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        block.appendTo(blockPosition, output);
    }
View Full Code Here

    public boolean isNull(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.isNull(blockPosition);
    }
View Full Code Here

    public boolean getBoolean(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getBoolean(blockPosition);
    }
View Full Code Here

    public long getLong(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getLong(blockPosition);
    }
View Full Code Here

    public double getDouble(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getDouble(blockPosition);
    }
View Full Code Here

    public Slice getSlice(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getSlice(blockPosition);
    }
View Full Code Here

TOP

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

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.