Package com.salesforce.phoenix.expression.function

Examples of com.salesforce.phoenix.expression.function.SingleAggregateFunction


   
    @Override
    public String toString() {
        StringBuilder buf = new StringBuilder(this.getClass().getName() + " [" + functions.length + "]:");
        for (int i = 0; i < functions.length; i++) {
            SingleAggregateFunction function = functions[i];
            buf.append("\t" + i + ") " + function );
        }
        return buf.toString();
    }
View Full Code Here


        try {
            DataOutputStream output = new DataOutputStream(stream);
            WritableUtils.writeVInt(output, minNullableIndex);
            WritableUtils.writeVInt(output, aggFuncs.size());
            for (int i = 0; i < aggFuncs.size(); i++) {
                SingleAggregateFunction aggFunc = aggFuncs.get(i);
                WritableUtils.writeVInt(output, ExpressionType.valueOf(aggFunc).ordinal());
                aggFunc.write(output);
            }
            return stream.toByteArray();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
View Full Code Here

            int len = WritableUtils.readVInt(input);
            Aggregator[] aggregators = new Aggregator[len];
            Expression[] expressions = new Expression[len];
            SingleAggregateFunction[] functions = new SingleAggregateFunction[len];
            for (int i = 0; i < aggregators.length; i++) {
                SingleAggregateFunction aggFunc = (SingleAggregateFunction)ExpressionType.values()[WritableUtils.readVInt(input)].newInstance();
                aggFunc.readFields(input, conf);
                functions[i] = aggFunc;
                aggregators[i] = aggFunc.getAggregator();
                expressions[i] = aggFunc.getAggregatorExpression();
            }
            return new ServerAggregators(functions, aggregators,expressions, minNullableIndex);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
View Full Code Here

       
    private static class SelectClauseVisitor extends ExpressionCompiler {
        private static int getMinNullableIndex(List<SingleAggregateFunction> aggFuncs, boolean isUngroupedAggregation) {
            int minNullableIndex = aggFuncs.size();
            for (int i = 0; i < aggFuncs.size(); i++) {
                SingleAggregateFunction aggFunc = aggFuncs.get(i);
                if (isUngroupedAggregation ? aggFunc.getAggregator().isNullable() : aggFunc.getAggregatorExpression().isNullable()) {
                    minNullableIndex = i;
                    break;
                }
            }
            return minNullableIndex;
View Full Code Here

            SingleAggregateFunction[] funcArray = aggregators.getFunctions();
            Aggregator[] sAggs = new Aggregator[funcArray.length];
            Boolean hasValue;
            schema.iterator(ptr);
            while ((hasValue = schema.next(ptr, i, maxOffset, tempValueSet)) != null) {
                SingleAggregateFunction func = funcArray[i];
                sAggs[i++] =
                        hasValue ? func.newServerAggregator(conf, ptr) : func
                                .newServerAggregator(conf);
            }
            return sAggs;

        } finally {
View Full Code Here

TOP

Related Classes of com.salesforce.phoenix.expression.function.SingleAggregateFunction

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.