Package com.facebook.presto.operator

Examples of com.facebook.presto.operator.GroupByHash$GroupByPageBuilder


        checkNotNull(block, "block is null");
        checkState(!finished, "already finished");

        if (type == null) {
            type = block.getType();
            dictionaryBuilder = new GroupByHash(ImmutableList.of(type), new int[] {0}, 1_000);
        }

        BlockBuilder idBlockBuilder = BIGINT.createBlockBuilder(new BlockBuilderStatus());
        for (int position = 0; position < block.getPositionCount(); position++) {
            int key = dictionaryBuilder.putIfAbsent(position, block);
View Full Code Here


            allChannels[i] = i;
        }

        ImmutableList.Builder<PageAndPositions> builder = ImmutableList.builder();
        long nextDistinctId = 0;
        GroupByHash groupByHash = new GroupByHash(types, allChannels, 10_000);
        for (UpdateRequest request : requests) {
            IntList positions = new IntArrayList();

            int startPosition = request.getStartPosition();
            Block[] blocks = request.getBlocks();

            // Move through the positions while advancing the cursors in lockstep
            int positionCount = blocks[0].getPositionCount();
            for (int position = startPosition; position < positionCount; position++) {
                // We are reading ahead in the cursors, so we need to filter any nulls since they can not join
                if (!containsNullValue(position, blocks) && groupByHash.putIfAbsent(position, blocks) == nextDistinctId) {
                    nextDistinctId++;

                    // Only include the key if it is not already in the index
                    if (existingSnapshot.getJoinPosition(position, blocks) == UNLOADED_INDEX_KEY) {
                        positions.add(position);
View Full Code Here

            allChannels[i] = i;
        }

        ImmutableList.Builder<PageAndPositions> builder = ImmutableList.builder();
        long nextDistinctId = 0;
        GroupByHash groupByHash = new GroupByHash(types, allChannels, 10_000);
        for (UpdateRequest request : requests) {
            IntList positions = new IntArrayList();

            BlockCursor[] cursors = request.duplicateCursors();

            // Move through the positions while advancing the cursors in lockstep
            int positionCount = cursors[0].getRemainingPositions() + 1;
            for (int index = 0; index < positionCount; index++) {
                // cursors are start at valid position, so we don't need to advance the first time
                if (index > 0) {
                    for (BlockCursor cursor : cursors) {
                        checkState(cursor.advanceNextPosition());
                    }
                }

                if (groupByHash.putIfAbsent(cursors) == nextDistinctId) {
                    nextDistinctId++;

                    // Only include the key if it is not already in the index
                    if (existingSnapshot.getJoinPosition(cursors) == UNLOADED_INDEX_KEY) {
                        positions.add(cursors[0].getPosition());
View Full Code Here

            allChannels[i] = i;
        }

        ImmutableList.Builder<PageAndPositions> builder = ImmutableList.builder();
        long nextDistinctId = 0;
        GroupByHash groupByHash = new GroupByHash(types, allChannels, 10_000);
        for (UpdateRequest request : requests) {
            IntList positions = new IntArrayList();

            int startPosition = request.getStartPosition();
            Block[] blocks = request.getBlocks();

            // Move through the positions while advancing the cursors in lockstep
            int positionCount = blocks[0].getPositionCount();
            for (int position = startPosition; position < positionCount; position++) {
                // We are reading ahead in the cursors, so we need to filter any nulls since they can not join
                if (!containsNullValue(position, blocks) && groupByHash.putIfAbsent(position, blocks) == nextDistinctId) {
                    nextDistinctId++;

                    // Only include the key if it is not already in the index
                    if (existingSnapshot.getJoinPosition(position, blocks) == UNLOADED_INDEX_KEY) {
                        positions.add(position);
View Full Code Here

            allChannels[i] = i;
        }

        ImmutableList.Builder<PageAndPositions> builder = ImmutableList.builder();
        long nextDistinctId = 0;
        GroupByHash groupByHash = new GroupByHash(types, allChannels, 10_000);
        for (UpdateRequest request : requests) {
            IntList positions = new IntArrayList();
            Block[] blocks = request.getBlocks();

            // Move through the positions while advancing the cursors in lockstep
            int positionCount = blocks[0].getPositionCount();
            for (int position = 0; position < positionCount; position++) {
                // We are reading ahead in the cursors, so we need to filter any nulls since they can not join
                if (!containsNullValue(position, blocks) && groupByHash.putIfAbsent(position, blocks) == nextDistinctId) {
                    nextDistinctId++;

                    // Only include the key if it is not already in the index
                    if (existingSnapshot.getJoinPosition(position, blocks) == UNLOADED_INDEX_KEY) {
                        positions.add(position);
View Full Code Here

    public DictionaryEncoder(Type type, Encoder idWriter)
    {
        this.type = type;
        this.idWriter = checkNotNull(idWriter, "idWriter is null");
        this.dictionaryBuilder = new GroupByHash(ImmutableList.of(type), new int[] {0}, 1_000);
    }
View Full Code Here

            allChannels[i] = i;
        }

        ImmutableList.Builder<PageAndPositions> builder = ImmutableList.builder();
        long nextDistinctId = 0;
        GroupByHash groupByHash = new GroupByHash(types, allChannels, 10_000);
        for (UpdateRequest request : requests) {
            IntList positions = new IntArrayList();

            BlockCursor[] cursors = request.duplicateCursors();

            // Move through the positions while advancing the cursors in lockstep
            int positionCount = cursors[0].getRemainingPositions() + 1;
            for (int index = 0; index < positionCount; index++) {
                // cursors are start at valid position, so we don't need to advance the first time
                if (index > 0) {
                    for (BlockCursor cursor : cursors) {
                        checkState(cursor.advanceNextPosition());
                    }
                }

                // We are reading ahead in the cursors, so we need to filter any nulls since they can not join
                if (!containsNullValue(cursors) && groupByHash.putIfAbsent(cursors) == nextDistinctId) {
                    nextDistinctId++;

                    // Only include the key if it is not already in the index
                    if (existingSnapshot.getJoinPosition(cursors) == UNLOADED_INDEX_KEY) {
                        positions.add(cursors[0].getPosition());
View Full Code Here

    public DictionaryEncoder(Type type, Encoder idWriter)
    {
        this.type = type;
        this.idWriter = checkNotNull(idWriter, "idWriter is null");
        this.dictionaryBuilder = new GroupByHash(ImmutableList.of(type), new int[] {0}, 1_000);
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.GroupByHash$GroupByPageBuilder

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.