Package com.facebook.presto.spi.type

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


                Block[] next = currentFlushingPartition.next();
                sizeDelta += sizeOfRow(next);
                for (int i = 0; i < outputChannels.length; i++) {
                    int channel = outputChannels[i];
                    Type type = types.get(channel);
                    type.appendTo(next[channel], 0, pageBuilder.getBlockBuilder(i));
                }

                BIGINT.writeLong(pageBuilder.getBlockBuilder(outputChannels.length), currentFlushingPartition.getRowNumber());
            }
            if (!currentFlushingPartition.hasNext()) {
View Full Code Here


    public void appendTo(PageBuilder pageBuilder)
    {
        for (int outputIndex = 0; outputIndex < blocks.length; outputIndex++) {
            Type type = types.get(outputIndex);
            Block block = blocks[outputIndex];
            type.appendTo(block, position, pageBuilder.getBlockBuilder(outputIndex));
        }
    }

    @Override
    public long getCurrentJoinPosition()
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.