Package com.facebook.presto.operator.AggregationOperator

Examples of com.facebook.presto.operator.AggregationOperator.Aggregator.addValue()


                .build();

        // verify addValue(Page)
        Aggregator aggregator1 = createAggregator(definition, Step.FINAL);
        for (Page input : inputs) {
            aggregator1.addValue(computePartial(function, input));
        }

        assertEquals(getResult(function.getFinalTupleInfo(), aggregator1), expected);

        // verify addValue(BlockCursor...)
View Full Code Here


            for (int i = 0; i < cursors.length; i++) {
                cursors[i] = partial.getBlock(i).cursor();
            }

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

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

                .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);
View Full Code Here

        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

        }

        AggregationFunctionDefinition definition = aggregation(function, inputs);

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

        return new Page(aggregator.getResult());
    }

    private static MaterializedResult getResult(TupleInfo tupleInfo, Aggregator aggregator)
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.