private void iterateNoNullsRepeatingWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double value, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.avgValue(value); } }
iterateNoNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize); } else { if (batch.selectedInUse) { iterateNoNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batch.selected, batchSize); } else { iterateNoNullsWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize); iterateHasNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize, inputVector.isNull); } else { if (batch.selectedInUse) { iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize, batch.selected, inputVector.isNull); } else { iterateHasNullsWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize, inputVector.isNull);
@Override public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { inputExpression.evaluate(batch); DoubleColumnVector inputVector = (DoubleColumnVector) batch.cols[ this.inputExpression.getOutputColumnNum()]; int batchSize = batch.size; if (batchSize == 0) { return; } Aggregation myagg = (Aggregation)agg; double[] vector = inputVector.vector; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { myagg.sum += vector[0]*batchSize; myagg.count += batchSize; } return; } if (!batch.selectedInUse && inputVector.noNulls) { iterateNoSelectionNoNulls(myagg, vector, batchSize); } else if (!batch.selectedInUse) { iterateNoSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull); } else if (inputVector.noNulls){ iterateSelectionNoNulls(myagg, vector, batchSize, batch.selected); } else { iterateSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull, batch.selected); } }
iterateNoNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize); } else { if (batch.selectedInUse) { iterateNoNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batch.selected, batchSize); } else { iterateNoNullsWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize); if (inputVector.isRepeating) { if (batch.selectedInUse) { iterateHasNullsRepeatingSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize, batch.selected, inputVector.isNull); } else { iterateHasNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize, inputVector.isNull); iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize, batch.selected, inputVector.isNull); } else { iterateHasNullsWithAggregationSelection( aggregationBufferSets, bufferIndex,
iterateNoSelectionNoNulls(myagg, vector, batchSize); iterateNoSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull); iterateSelectionNoNulls(myagg, vector, batchSize, batch.selected); iterateSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull, batch.selected);
private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.avgValue(values[i]); } }
iterateNoNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize); } else { if (batch.selectedInUse) { iterateNoNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batch.selected, batchSize); } else { iterateNoNullsWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize); if (inputVector.isRepeating) { if (batch.selectedInUse) { iterateHasNullsRepeatingSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize, batch.selected, inputVector.isNull); } else { iterateHasNullsRepeatingWithAggregationSelection( aggregationBufferSets, bufferIndex, vector[0], batchSize, inputVector.isNull); iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, bufferIndex, vector, batchSize, batch.selected, inputVector.isNull); } else { iterateHasNullsWithAggregationSelection( aggregationBufferSets, bufferIndex,
iterateNoSelectionNoNulls(myagg, vector, batchSize); iterateNoSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull); iterateSelectionNoNulls(myagg, vector, batchSize, batch.selected); iterateSelectionHasNulls(myagg, vector, batchSize, inputVector.isNull, batch.selected);
private void iterateNoNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int[] selection, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.avgValue(values[selection[i]]); } }
private void iterateNoNullsRepeatingWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double value, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(value); } }
private void iterateHasNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize, int[] selection, boolean[] isNull) { for (int j=0; j < batchSize; ++j) { int i = selection[j]; if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, j); myagg.avgValue(values[i]); } } }
private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(values[i]); } }
private void iterateHasNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize, boolean[] isNull) { for (int i=0; i < batchSize; ++i) { if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.avgValue(values[i]); } } }
private void iterateHasNullsRepeatingWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double value, int batchSize, boolean[] isNull) { if (isNull[0]) { return; } for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.avgValue(value); } }
private void iterateNoNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int[] selection, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(values[selection[i]]); } }
private void iterateHasNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize, boolean[] isNull) { for (int i=0; i < batchSize; ++i) { if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(values[i]); } } }
private void iterateHasNullsRepeatingWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double value, int batchSize, boolean[] isNull) { if (isNull[0]) { return; } for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(value); } }
private void iterateHasNullsRepeatingSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double value, int batchSize, int[] selection, boolean[] isNull) { if (isNull[0]) { return; } for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(value); } }
private void iterateHasNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize, int[] selection, boolean[] isNull) { for (int j=0; j < batchSize; ++j) { int i = selection[j]; if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, j); myagg.sumValue(values[i]); } } }
private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int bufferIndex, double[] values, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, bufferIndex, i); myagg.sumValue(values[i]); } }