Package com.facebook.presto.operator.aggregation

Examples of com.facebook.presto.operator.aggregation.AggregationFunction


        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createGroupedIntermediateAggregation(functionDefinition.getConfidence());
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                aggregation = function.createGroupedAggregation(
                        functionDefinition.getMask().transform(Input.channelGetter()),
                        functionDefinition.getSampleWeight().transform(Input.channelGetter()),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
View Full Code Here


        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createGroupedIntermediateAggregation();
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                Optional<Integer> maskChannel = Optional.absent();
                if (functionDefinition.getMask().isPresent()) {
                    maskChannel = Optional.of(functionDefinition.getMask().get().getChannel());
                }
                aggregation = function.createGroupedAggregation(maskChannel, argumentChannels);
            }
            this.step = step;
        }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step != Step.FINAL) {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                Optional<Integer> maskChannel = Optional.absent();
                if (functionDefinition.getMask().isPresent()) {
                    maskChannel = Optional.of(functionDefinition.getMask().get().getChannel());
                }
                aggregation = function.createAggregation(maskChannel, argumentChannels);
            }
            else {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createIntermediateAggregation();
            }
            this.step = step;
        }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0);
                aggregation = function.createGroupedIntermediateAggregation(functionDefinition.getConfidence());
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i);
                }
                intermediateChannel = -1;
                aggregation = function.createGroupedAggregation(
                        functionDefinition.getMask(),
                        functionDefinition.getSampleWeight(),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step, MemoryManager memoryManager)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step != Step.FINAL) {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i);
                }
                intermediateChannel = -1;
                aggregation = function.createAggregation(
                        functionDefinition.getMask(),
                        functionDefinition.getSampleWeight(),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
            else {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0);
                aggregation = function.createIntermediateAggregation(functionDefinition.getConfidence());
            }
            this.step = step;
            this.memoryManager = memoryManager;
        }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createGroupedIntermediateAggregation();
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                Optional<Integer> maskChannel = Optional.absent();
                if (functionDefinition.getMask().isPresent()) {
                    maskChannel = Optional.of(functionDefinition.getMask().get().getChannel());
                }
                aggregation = function.createGroupedAggregation(maskChannel, argumentChannels);
            }
            this.step = step;
        }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createGroupedIntermediateAggregation(functionDefinition.getConfidence());
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                aggregation = function.createGroupedAggregation(
                        functionDefinition.getMask().transform(Input.channelGetter()),
                        functionDefinition.getSampleWeight().transform(Input.channelGetter()),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step, MemoryManager memoryManager)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step != Step.FINAL) {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                aggregation = function.createAggregation(
                        functionDefinition.getMask().transform(Input.channelGetter()),
                        functionDefinition.getSampleWeight().transform(Input.channelGetter()),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
            else {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createIntermediateAggregation(functionDefinition.getConfidence());
            }
            this.step = step;
            this.memoryManager = memoryManager;
        }
View Full Code Here

        private final int intermediateChannel;

        private Aggregator(AggregationFunctionDefinition functionDefinition, Step step)
        {
            AggregationFunction function = functionDefinition.getFunction();

            if (step == Step.FINAL) {
                checkArgument(functionDefinition.getInputs().size() == 1, "Expected a single input for an intermediate aggregation");
                intermediateChannel = functionDefinition.getInputs().get(0).getChannel();
                aggregation = function.createGroupedIntermediateAggregation(functionDefinition.getConfidence());
            }
            else {
                int[] argumentChannels = new int[functionDefinition.getInputs().size()];
                for (int i = 0; i < argumentChannels.length; i++) {
                    argumentChannels[i] = functionDefinition.getInputs().get(i).getChannel();
                }
                intermediateChannel = -1;
                aggregation = function.createGroupedAggregation(
                        functionDefinition.getMask().transform(Input.channelGetter()),
                        functionDefinition.getSampleWeight().transform(Input.channelGetter()),
                        functionDefinition.getConfidence(),
                        argumentChannels);
            }
View Full Code Here

    }

    @VisibleForTesting
    public static Aggregator createAggregator(AggregationFunctionDefinition functionDefinition, Step step)
    {
        AggregationFunction function = functionDefinition.getFunction();
        if (function instanceof VariableWidthAggregationFunction) {
            return new VariableWidthAggregator<>((VariableWidthAggregationFunction<Object>) functionDefinition.getFunction(), functionDefinition.getInputs(), step);
        }
        else {
            Input input = null;
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.aggregation.AggregationFunction

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.