Package com.facebook.presto.operator.AggregationOperator

Examples of com.facebook.presto.operator.AggregationOperator.Aggregator


        MaterializedResult expected = MaterializedResult.resultBuilder(function.getFinalTupleInfo())
                .row(new Object[] {expectedValue})
                .build();

        // verify addInput(Page)
        Aggregator aggregator1 = createAggregator(definition, Step.SINGLE);
        aggregator1.addValue(input);
        assertEquals(getResult(function.getFinalTupleInfo(), aggregator1), expected);

        // verify addInput(BlockCursors...)
        Aggregator aggregator2 = createAggregator(definition, Step.SINGLE);

        BlockCursor[] cursors = new BlockCursor[input.getBlocks().length];
        for (int i = 0; i < cursors.length; i++) {
            cursors[i] = input.getBlock(i).cursor();
        }

        while (BlockAssertions.advanceAllCursorsToNextPosition(cursors)) {
            aggregator2.addValue(cursors);
        }

        assertEquals(getResult(function.getFinalTupleInfo(), aggregator2), expected);
    }
View Full Code Here


            inputs.add(new Input(i, 0));
        }

        AggregationFunctionDefinition definition = aggregation(function, inputs);

        Aggregator aggregator = createAggregator(definition, Step.PARTIAL);
        aggregator.addValue(input);

        return new Page(aggregator.getResult());
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.AggregationOperator.Aggregator

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.