/** * @param functions * @param specIndex * @param rowValues * @return */ private List<AggregateFunction> initializeAccumulators(List<WindowFunctionInfo> functions, int specIndex) { List<AggregateFunction> aggs = new ArrayList<AggregateFunction>(functions.size()); if (functions.isEmpty()) { return aggs; } List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size()); ElementSymbol key = new ElementSymbol("key"); //$NON-NLS-1$ key.setType(DataTypeManager.DefaultDataClasses.INTEGER); elements.add(key); for (WindowFunctionInfo wfi : functions) { AggregateFunction aggregateFunction = GroupingNode.initAccumulator(wfi.function.getFunction(), this, expressionIndexes); aggs.add(aggregateFunction); Class<?> outputType = aggregateFunction.getOutputType(wfi.function.getFunction()); ElementSymbol value = new ElementSymbol("val"); //$NON-NLS-1$ value.setType(outputType); elements.add(value); } valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1); return aggs; }
/** * @param functions * @param specIndex * @param rowValues * @return */ private List<AggregateFunction> initializeAccumulators(List<WindowFunctionInfo> functions, int specIndex) { List<AggregateFunction> aggs = new ArrayList<AggregateFunction>(functions.size()); if (functions.isEmpty()) { return aggs; } List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size()); ElementSymbol key = new ElementSymbol("key"); //$NON-NLS-1$ key.setType(DataTypeManager.DefaultDataClasses.INTEGER); elements.add(key); for (WindowFunctionInfo wfi : functions) { AggregateFunction aggregateFunction = GroupingNode.initAccumulator(wfi.function.getFunction(), this, expressionIndexes); aggs.add(aggregateFunction); Class<?> outputType = aggregateFunction.getOutputType(wfi.function.getFunction()); ElementSymbol value = new ElementSymbol("val"); //$NON-NLS-1$ value.setType(outputType); elements.add(value); } valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1); return aggs; }
elements.add(key); for (WindowFunctionInfo wfi : functions) { aggs.add(GroupingNode.initAccumulator(wfi.function.getFunction(), this, expressionIndexes)); Class<?> outputType = wfi.function.getType(); if (wfi.function.getFunction().getAggregateFunction() == Type.LEAD
functions[i] = new AggregateFunction[rollup?orderBy.size()+1:1]; for (int j = 0; j < functions[i].length; j++) { functions[i][j] = initAccumulator(aggSymbol, this, this.collectedExpressions);
functions[i] = new AggregateFunction[rollup?orderBy.size()+1:1]; for (int j = 0; j < functions[i].length; j++) { functions[i][j] = initAccumulator(aggSymbol, this, this.collectedExpressions);
functions[i] = new AggregateFunction[rollup?orderBy.size()+1:1]; for (int j = 0; j < functions[i].length; j++) { functions[i][j] = initAccumulator(aggSymbol, this, this.collectedExpressions);