Package com.facebook.presto.spi.block

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


        {
            if (!sliceInput.isReadable()) {
                return endOfData();
            }

            Block block = blockEncoding.readBlock(sliceInput);
            return block;
        }
View Full Code Here


            if (blockEncodings == null) {
                Block[] blocks = page.getBlocks();
                blockEncodings = new BlockEncoding[blocks.length];
                sliceOutput.writeInt(blocks.length);
                for (int i = 0; i < blocks.length; i++) {
                    Block block = blocks[i];
                    BlockEncoding blockEncoding = block.getEncoding();
                    blockEncodings[i] = blockEncoding;
                    blockEncodingSerde.writeBlockEncoding(sliceOutput, blockEncoding);
                }
            }
View Full Code Here

        // create the block builder for the new boolean column
        // we know the exact size required for the block
        BlockBuilder blockBuilder = BOOLEAN.createFixedSizeBlockBuilder(page.getPositionCount());

        Block probeJoinBlock = page.getBlock(probeJoinChannel);
        BlockCursor probeJoinCursor = probeJoinBlock.cursor();

        // update hashing strategy to use probe cursor
        channelSet.setCurrentValue(probeJoinCursor);

        for (int position = 0; position < page.getPositionCount(); position++) {
View Full Code Here

            nextPage = page;
        }
        else {
            Block[] blocks = new Block[page.getChannelCount()];
            for (int channel = 0; channel < page.getChannelCount(); channel++) {
                Block block = page.getBlock(channel);
                blocks[channel] = block.getRegion(0, (int) remainingLimit);
            }
            nextPage = new Page((int) remainingLimit, blocks);
            remainingLimit = 0;
        }
    }
View Full Code Here

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

        checkNotNull(page, "page is null");
        checkState(!finishing, "Operator is finishing");
        checkState(outputPage == null, "Operator still has pending output");
        operatorContext.setMemoryReservation(markDistinctHash.getEstimatedSize());

        Block markerBlock = markDistinctHash.markDistinctRows(page);

        // 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
View Full Code Here

    @Override
    public boolean positionEqualsPosition(int leftBlockIndex, int leftBlockPosition, int rightBlockIndex, int rightBlockPosition)
    {
        for (List<Block> channel : hashChannels) {
            Block leftBlock = channel.get(leftBlockIndex);
            Block rightBlock = channel.get(rightBlockIndex);
            if (!leftBlock.equalTo(leftBlockPosition, rightBlock, rightBlockPosition)) {
                return false;
            }
        }
View Full Code Here

        @Override
        protected void processInput(GroupByIdBlock groupIdsBlock, Block values, Optional<Block> maskBlock, Optional<Block> sampleWeightBlock)
        {
            groupedState.ensureCapacity(groupIdsBlock.getGroupCount());

            Block masks = null;
            if (maskBlock.isPresent()) {
                masks = maskBlock.get();
            }
            Block sampleWeights = null;
            if (sampleWeightBlock.isPresent()) {
                sampleWeights = sampleWeightBlock.get();
            }

            for (int position = 0; position < groupIdsBlock.getPositionCount(); position++) {
View Full Code Here

        }

        @Override
        protected void processInput(Block values, Optional<Block> maskBlock, Optional<Block> sampleWeightBlock)
        {
            Block masks = null;
            if (maskBlock.isPresent()) {
               masks = maskBlock.get();
            }
            Block sampleWeights = null;
            if (sampleWeightBlock.isPresent()) {
                sampleWeights = sampleWeightBlock.get();
            }

            for (int position = 0; position < values.getPositionCount(); position++) {
View Full Code Here

        protected void processInput(GroupByIdBlock groupIdsBlock, Block values, Optional<Block> maskBlock, Optional<Block> sampleWeightBlock)
        {
            checkArgument(!sampleWeightBlock.isPresent(), "Sampled data not supported");
            groupedState.ensureCapacity(groupIdsBlock.getGroupCount());

            Block masks = null;
            if (maskBlock.isPresent()) {
                masks = maskBlock.get();
            }

            for (int position = 0; position < groupIdsBlock.getPositionCount(); position++) {
                if (masks != null && !masks.getBoolean(position)) {
                    continue;
                }
                if (!values.isNull(position)) {
                    groupedState.setGroupId(groupIdsBlock.getGroupId(position));
                    AbstractAggregationFunction.this.processInput(state, values, position);
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.