Package com.facebook.presto.spi.block

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


    public int compare(Block[] leftRow, Block[] rightRow)
    {
        for (int index = 0; index < sortChannels.size(); index++) {
            Type type = sortTypes.get(index);
            int channel = sortChannels.get(index);
            SortOrder sortOrder = sortOrders.get(index);

            Block left = leftRow[channel];
            Block right = rightRow[channel];

            int comparison = sortOrder.compareBlockValue(type, left, 0, right, 0);
            if (comparison != 0) {
                return comparison;
            }
        }
        return 0;
View Full Code Here


        for (int i = 0; i < sortChannels.size(); i++) {
            int sortChannel = sortChannels.get(i);
            Block leftBlock = pagesIndex.getChannel(sortChannel).get(leftBlockIndex);
            Block rightBlock = pagesIndex.getChannel(sortChannel).get(rightBlockIndex);

            SortOrder sortOrder = sortOrders.get(i);
            int compare = sortOrder.compareBlockValue(sortTypes.get(i), leftBlock, leftBlockPosition, rightBlock, rightBlockPosition);
            if (compare != 0) {
                return compare;
            }
        }
        return 0;
View Full Code Here

        private int compare(int position, Block[] blocks, Block[] currentMax)
        {
            for (int i = 0; i < sortChannels.size(); i++) {
                Type type = sortTypes.get(i);
                int sortChannel = sortChannels.get(i);
                SortOrder sortOrder = sortOrders.get(i);

                Block block = blocks[sortChannel];
                Block currentMaxValue = currentMax[sortChannel];

                // compare the right value to the left block but negate the result since we are evaluating in the opposite order
                int compare = -sortOrder.compareBlockValue(type, currentMaxValue, 0, block, position);
                if (compare != 0) {
                    return compare;
                }
            }
            return 0;
View Full Code Here

    private int compare(int position, Block[] blocks, Block[] currentMax)
    {
        for (int i = 0; i < sortChannels.size(); i++) {
            Type type = sortTypes.get(i);
            int sortChannel = sortChannels.get(i);
            SortOrder sortOrder = sortOrders.get(i);

            Block block = blocks[sortChannel];
            Block currentMaxValue = currentMax[sortChannel];

            int compare = sortOrder.compareBlockValue(type, block, position, currentMaxValue, 0);
            if (compare != 0) {
                return compare;
            }
        }
        return 0;
View Full Code Here

        private int compare(int position, Block[] blocks, Block[] currentMax)
        {
            for (int i = 0; i < sortChannels.size(); i++) {
                Type type = sortTypes.get(i);
                int sortChannel = sortChannels.get(i);
                SortOrder sortOrder = sortOrders.get(i);

                Block block = blocks[sortChannel];
                Block currentMaxValue = currentMax[sortChannel];

                // compare the right value to the left block but negate the result since we are evaluating in the opposite order
                int compare = -sortOrder.compareBlockValue(type, currentMaxValue, 0, block, position);
                if (compare != 0) {
                    return compare;
                }
            }
            return 0;
View Full Code Here

    private int compare(int position, Block[] blocks, Block[] currentMax)
    {
        for (int i = 0; i < sortChannels.size(); i++) {
            Type type = sortTypes.get(i);
            int sortChannel = sortChannels.get(i);
            SortOrder sortOrder = sortOrders.get(i);

            Block block = blocks[sortChannel];
            Block currentMaxValue = currentMax[sortChannel];

            int compare = sortOrder.compareBlockValue(type, block, position, currentMaxValue, 0);
            if (compare != 0) {
                return compare;
            }
        }
        return 0;
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.block.SortOrder

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.