Package com.facebook.presto.spi.type

Examples of com.facebook.presto.spi.type.Type.appendTo()


                int position = unloadedKeyRecordCursor.getPosition();
                if (lookupSource.getJoinPosition(position, blocks) < 0) {
                    for (int i = 0; i < blocks.length; i++) {
                        Block block = blocks[i];
                        Type type = unloadedKeyRecordCursor.getType(i);
                        type.appendTo(block, position, missingKeysPageBuilder.getBlockBuilder(i));
                    }
                }
            }

            // only update missing keys if we have new missing keys
View Full Code Here


    private int addNewGroup(int hashPosition, int position, Block[] blocks)
    {
        // add the row to the open page
        for (int i = 0; i < blocks.length; i++) {
            Type type = types.get(i);
            type.appendTo(blocks[i], position, currentPageBuilder.getBlockBuilder(i));
        }
        currentPageBuilder.declarePosition();
        int pageIndex = channelBuilders.get(0).size() - 1;
        int pagePosition = currentPageBuilder.getPositionCount() - 1;
        long address = encodeSyntheticAddress(pageIndex, pagePosition);
View Full Code Here

                    continue;
                }

                for (int channel = 0; channel < types.size(); channel++) {
                    Type type = types.get(channel);
                    type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel));
                }

                // if page is full, flush
                if (pageBuilder.isFull()) {
                    partitionedPages.add(pageBuilder.build());
View Full Code Here

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

            position++;
        }
View Full Code Here

        long pageAddress = valueAddresses.getLong(position);

        Type type = types.get(channel);
        Block block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        type.appendTo(block, blockPosition, output);
    }

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

    private int addNewGroup(int hashPosition, int position, Block[] blocks)
    {
        // add the row to the open page
        for (int i = 0; i < blocks.length; i++) {
            Type type = types.get(i);
            type.appendTo(blocks[i], position, currentPageBuilder.getBlockBuilder(i));
        }
        currentPageBuilder.declarePosition();
        int pageIndex = channelBuilders.get(0).size() - 1;
        int pagePosition = currentPageBuilder.getPositionCount() - 1;
        long address = encodeSyntheticAddress(pageIndex, pagePosition);
View Full Code Here

        GroupByIdBlock ids = groupByHash.getGroupIds(page);
        for (int position = 0; position < ids.getPositionCount(); position++) {
            if (ids.getGroupId(position) == nextDistinctId) {
                for (int channel = 0; channel < types.size(); channel++) {
                    Type type = types.get(channel);
                    type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel));
                }
                remainingLimit--;
                nextDistinctId++;
                if (remainingLimit == 0) {
                    break;
View Full Code Here

                if (repeats > 0) {
                    // copy input values to output page
                    // NOTE: last output type is sample weight so we skip it
                    for (int channel = 0; channel < types.size() - 1; channel++) {
                        Type type = types.get(channel);
                        type.appendTo(page.getBlock(channel), position, pageBuilder.getBlockBuilder(channel));
                    }
                    BIGINT.writeLong(pageBuilder.getBlockBuilder(sampleWeightChannel), repeats);
                }

                position++;
View Full Code Here

            long rowCount = partitionRowCount.get(partitionId);
            if (rowCount < maxRowCountPerPartition) {
                for (int i = 0; i < outputChannels.length; i++) {
                    int channel = outputChannels[i];
                    Type type = types.get(channel);
                    type.appendTo(inputPage.getBlock(channel), currentPosition, pageBuilder.getBlockBuilder(i));
                }
                BIGINT.writeLong(pageBuilder.getBlockBuilder(types.size() - 1), rowCount + 1);
                partitionRowCount.set(partitionId, rowCount + 1);
            }
            currentPosition++;
View Full Code Here

            int position = unloadedKeyRecordCursor.getPosition();
            if (lookupSource.getJoinPosition(position, blocks) < 0) {
                for (int i = 0; i < blocks.length; i++) {
                    Block block = blocks[i];
                    Type type = unloadedKeyRecordCursor.getType(i);
                    type.appendTo(block, position, missingKeysPageBuilder.getBlockBuilder(i));
                }
            }
        }
        Page missingKeysPage = missingKeysPageBuilder.build();
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.