private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } }
public VectorUDAFCount(VectorAggregationDesc vecAggrDesc) { super(vecAggrDesc); init(); }
@Override public void aggregateInputSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, VectorizedRowBatch batch) throws HiveException { int batchSize = batch.size; if (batchSize == 0) { return; } inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumnNum()]; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { iterateNoNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize); } } else if (inputVector.noNulls) { // if there are no nulls then the iteration is the same on all cases iterateNoNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize); } else if (!batch.selectedInUse) { iterateHasNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, inputVector.isNull); } else if (batch.selectedInUse) { iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, batch.selected, inputVector.isNull); } }
@Override public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumnNum()]; int batchSize = batch.size; if (batchSize == 0) { return; } Aggregation myagg = (Aggregation)agg; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { myagg.count += batchSize; } return; } if (inputVector.noNulls) { myagg.count += batchSize; return; } else if (!batch.selectedInUse) { iterateNoSelectionHasNulls(myagg, batchSize, inputVector.isNull); } else { iterateSelectionHasNulls(myagg, batchSize, inputVector.isNull, batch.selected); } }
@Override public void aggregateInputSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, VectorizedRowBatch batch) throws HiveException { int batchSize = batch.size; if (batchSize == 0) { return; } inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumn()]; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { iterateNoNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize); } } else if (inputVector.noNulls) { // if there are no nulls then the iteration is the same on all cases iterateNoNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize); } else if (!batch.selectedInUse) { iterateHasNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, inputVector.isNull); } else if (batch.selectedInUse) { iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, batch.selected, inputVector.isNull); } }
@Override public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumn()]; int batchSize = batch.size; if (batchSize == 0) { return; } Aggregation myagg = (Aggregation)agg; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { myagg.count += batchSize; } return; } if (inputVector.noNulls) { myagg.count += batchSize; return; } else if (!batch.selectedInUse) { iterateNoSelectionHasNulls(myagg, batchSize, inputVector.isNull); } else { iterateSelectionHasNulls(myagg, batchSize, inputVector.isNull, batch.selected); } }
@Override public void aggregateInputSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, VectorizedRowBatch batch) throws HiveException { int batchSize = batch.size; if (batchSize == 0) { return; } inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumn()]; if (inputVector.noNulls) { // if there are no nulls then the iteration is the same on all cases iterateNoNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize); } else if (!batch.selectedInUse) { iterateHasNullsWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, inputVector.isNull); } else if (batch.selectedInUse) { iterateHasNullsSelectionWithAggregationSelection( aggregationBufferSets, aggregateIndex, batchSize, batch.selected, inputVector.isNull); } }
@Override public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException { inputExpression.evaluate(batch); ColumnVector inputVector = batch.cols[this.inputExpression.getOutputColumn()]; int batchSize = batch.size; if (batchSize == 0) { return; } Aggregation myagg = (Aggregation)agg; if (inputVector.isRepeating) { if (inputVector.noNulls || !inputVector.isNull[0]) { myagg.count += batchSize; } return; } if (inputVector.noNulls) { myagg.count += batchSize; return; } else if (!batch.selectedInUse) { iterateNoSelectionHasNulls(myagg, batchSize, inputVector.isNull); } else { iterateSelectionHasNulls(myagg, batchSize, inputVector.isNull, batch.selected); } }
private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } }
private void iterateHasNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, boolean[] isNull) { for (int i=0; i < batchSize; ++i) { if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } } }
private void iterateHasNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, boolean[] isNull) { for (int i=0; i < batchSize; ++i) { if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } } }
private void iterateHasNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, int[] selection, boolean[] isNull) { for (int j=0; j < batchSize; ++j) { int i = selection[j]; if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, j); myagg.count++; } } }
private void iterateHasNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, int[] selection, boolean[] isNull) { for (int j=0; j < batchSize; ++j) { int i = selection[j]; if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, j); myagg.count++; } } }
private void iterateNoNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize) { for (int i=0; i < batchSize; ++i) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } }
private void iterateHasNullsWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, boolean[] isNull) { for (int i=0; i < batchSize; ++i) { if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, i); myagg.count++; } } }
private void iterateHasNullsSelectionWithAggregationSelection( VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, int batchSize, int[] selection, boolean[] isNull) { for (int j=0; j < batchSize; ++j) { int i = selection[j]; if (!isNull[i]) { Aggregation myagg = getCurrentAggregationBuffer( aggregationBufferSets, aggregateIndex, j); myagg.count++; } } }