Examples of UncompressedBlock


Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

            partialAggregation.addInput(createGroupByIdBlock(0, page.getPositionCount()), page);
        }

        BlockBuilder partialOut = new BlockBuilder(partialAggregation.getIntermediateTupleInfo());
        partialAggregation.evaluateIntermediate(0, partialOut);
        UncompressedBlock partialBlock = partialOut.build();

        GroupedAccumulator finalAggregation = function.createGroupedIntermediateAggregation(confidence);
        finalAggregation.addIntermediate(createGroupByIdBlock(0, partialBlock.getPositionCount()), partialBlock);

        return getGroupValue(finalAggregation, 0);
    }
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

    }

    public static GroupByIdBlock createGroupByIdBlock(int groupId, int positions)
    {
        if (positions == 0) {
            return new GroupByIdBlock(groupId, new UncompressedBlock(0, TupleInfo.SINGLE_LONG, Slices.EMPTY_SLICE));
        }

        BlockBuilder blockBuilder = new BlockBuilder(TupleInfo.SINGLE_LONG);
        for (int i = 0; i < positions; i++) {
            blockBuilder.append(groupId);
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

            partialAggregation.addInput(createGroupByIdBlock(0, page.getPositionCount()), page);
        }

        BlockBuilder partialOut = new BlockBuilder(partialAggregation.getIntermediateTupleInfo());
        partialAggregation.evaluateIntermediate(0, partialOut);
        UncompressedBlock partialBlock = partialOut.build();

        GroupedAccumulator finalAggregation = function.createGroupedIntermediateAggregation(confidence);
        // Add an empty block to test the handling of empty intermediates
        GroupedAccumulator emptyAggregation = function.createGroupedAggregation(Optional.<Integer>absent(), Optional.<Integer>absent(), confidence, args);
        BlockBuilder emptyOut = new BlockBuilder(emptyAggregation.getIntermediateTupleInfo());
        emptyAggregation.evaluateIntermediate(0, emptyOut);
        UncompressedBlock emptyBlock = emptyOut.build();
        finalAggregation.addIntermediate(createGroupByIdBlock(0, emptyBlock.getPositionCount()), emptyBlock);

        finalAggregation.addIntermediate(createGroupByIdBlock(0, partialBlock.getPositionCount()), partialBlock);

        return getGroupValue(finalAggregation, 0);
    }
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

    }

    public static GroupByIdBlock createGroupByIdBlock(int groupId, int positions)
    {
        if (positions == 0) {
            return new GroupByIdBlock(groupId, new UncompressedBlock(0, TupleInfo.SINGLE_LONG, Slices.EMPTY_SLICE));
        }

        BlockBuilder blockBuilder = new BlockBuilder(TupleInfo.SINGLE_LONG);
        for (int i = 0; i < positions; i++) {
            blockBuilder.append(groupId);
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

    {
        Block valuesBlock;
        Block percentilesBlock;

        if (values.length == 0) {
            valuesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
            percentilesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
        }
        else {
            valuesBlock = createDoublesBlock(values);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
        }
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

    {
        Block valuesBlock;
        Block percentilesBlock;

        if (values.length == 0) {
            valuesBlock = new UncompressedBlock(0, SINGLE_LONG, EMPTY_SLICE);
            percentilesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
        }
        else {
            valuesBlock = createLongsBlock(values);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
        }
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

        Block valuesBlock;
        Block weightsBlock;
        Block percentilesBlock;

        if (values.length == 0) {
            valuesBlock = new UncompressedBlock(0, SINGLE_LONG, EMPTY_SLICE);
            weightsBlock = new UncompressedBlock(0, SINGLE_LONG, EMPTY_SLICE);
            percentilesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
        }
        else {
            valuesBlock = createLongsBlock(values);
            weightsBlock = createLongsBlock(weights);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

        Block valuesBlock;
        Block weightsBlock;
        Block percentilesBlock;

        if (values.length == 0) {
            valuesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
            weightsBlock = new UncompressedBlock(0, SINGLE_LONG, EMPTY_SLICE);
            percentilesBlock = new UncompressedBlock(0, SINGLE_DOUBLE, EMPTY_SLICE);
        }
        else {
            valuesBlock = createDoublesBlock(values);
            weightsBlock = createLongsBlock(weights);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

        checkState(!finishing, "Operator is finishing");
        checkState(channelSet != null, "Set has not been built yet");
        checkState(outputPage == null, "Operator still has pending output");

        // update hashing strategy to use probe block
        UncompressedBlock probeJoinBlock = (UncompressedBlock) page.getBlock(probeJoinChannel);
        channelSet.setLookupSlice(probeJoinBlock.getSlice());

        // create the block builder for the new boolean column
        // we know the exact size required for the block
        int blockSize = page.getPositionCount() * TupleInfo.SINGLE_BOOLEAN.getFixedSize();
        BlockBuilder blockBuilder = new BlockBuilder(TupleInfo.SINGLE_BOOLEAN, blockSize, Slices.allocate(blockSize).getOutput());

        BlockCursor probeJoinCursor = probeJoinBlock.cursor();
        for (int position = 0; position < page.getPositionCount(); position++) {
            checkState(probeJoinCursor.advanceNextPosition());
            if (probeJoinCursor.isNull()) {
                blockBuilder.appendNull();
            }
View Full Code Here

Examples of com.facebook.presto.block.uncompressed.UncompressedBlock

            if (groupId < 0) {
                groupId = addNewGroup(cursors);
            }
            blockBuilder.append(groupId);
        }
        UncompressedBlock block = blockBuilder.build();
        return new GroupByIdBlock(nextGroupId, block);
    }
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.