@Override public void doProcessBatch(VectorizedRowBatch batch, boolean isFirstGroupingSet, boolean[] currentGroupingSetsOverrideIsNulls) throws HiveException { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers.getAggregationBuffer(i), batch); } }
/** * Evaluates the aggregators on the current batch. * The aggregationBatchInfo must have been prepared * by calling {@link #prepareBatchAggregationBufferSets} first. */ protected void processAggregators(VectorizedRowBatch batch) throws HiveException { // We now have a vector of aggregation buffer sets to use for each row // We can start computing the aggregates. // If the number of distinct keys in the batch is 1 we can // use the optimized code path of aggregateInput VectorAggregationBufferRow[] aggregationBufferSets = aggregationBatchInfo.getAggregationBuffers(); if (aggregationBatchInfo.getDistinctBufferSetCount() == 1) { VectorAggregateExpression.AggregationBuffer[] aggregationBuffers = aggregationBufferSets[0].getAggregationBuffers(); for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers[i], batch); } } else { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInputSelection( aggregationBufferSets, i, batch); } } }
/** * Evaluates the aggregators on the current batch. * The aggregationBatchInfo must have been prepared * by calling {@link #prepareBatchAggregationBufferSets} first. */ protected void processAggregators(VectorizedRowBatch batch) throws HiveException { // We now have a vector of aggregation buffer sets to use for each row // We can start computing the aggregates. // If the number of distinct keys in the batch is 1 we can // use the optimized code path of aggregateInput VectorAggregationBufferRow[] aggregationBufferSets = aggregationBatchInfo.getAggregationBuffers(); if (aggregationBatchInfo.getDistinctBufferSetCount() == 1) { VectorAggregateExpression.AggregationBuffer[] aggregationBuffers = aggregationBufferSets[0].getAggregationBuffers(); for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers[i], batch); } } else { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInputSelection( aggregationBufferSets, i, batch); } } }
@Override public void doProcessBatch(VectorizedRowBatch batch, boolean isFirstGroupingSet, boolean[] currentGroupingSetsOverrideIsNulls) throws HiveException { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers.getAggregationBuffer(i), batch); } }
/** * Evaluates the aggregators on the current batch. * The aggregationBatchInfo must have been prepared * by calling {@link #prepareBatchAggregationBufferSets} first. */ protected void processAggregators(VectorizedRowBatch batch) throws HiveException { // We now have a vector of aggregation buffer sets to use for each row // We can start computing the aggregates. // If the number of distinct keys in the batch is 1 we can // use the optimized code path of aggregateInput VectorAggregationBufferRow[] aggregationBufferSets = aggregationBatchInfo.getAggregationBuffers(); if (aggregationBatchInfo.getDistinctBufferSetCount() == 1) { VectorAggregateExpression.AggregationBuffer[] aggregationBuffers = aggregationBufferSets[0].getAggregationBuffers(); for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers[i], batch); } } else { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInputSelection( aggregationBufferSets, i, batch); } } }
@Override public void doProcessBatch(VectorizedRowBatch batch, boolean isFirstGroupingSet, boolean[] currentGroupingSetsOverrideIsNulls) throws HiveException { assert(inGroup); if (first) { // Copy the group key to output batch now. We'll copy in the aggregates at the end of the group. first = false; groupKeyHelper.copyGroupKey(batch, outputBatch, buffer); } // Aggregate this batch. for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(groupAggregators.getAggregationBuffer(i), batch); } }
@Override public void doProcessBatch(VectorizedRowBatch batch, boolean isFirstGroupingSet, boolean[] currentGroupingSetsOverrideIsNulls) throws HiveException { if (first) { // Copy the group key to output batch now. We'll copy in the aggregates at the end of the group. first = false; // Evaluate the key expressions of just this first batch to get the correct key. for (int i = 0; i < outputKeyLength; i++) { keyExpressions[i].evaluate(batch); } groupKeyHelper.copyGroupKey(batch, outputBatch, buffer); } // Aggregate this batch. for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(groupAggregators.getAggregationBuffer(i), batch); } if (isLastGroupBatch) { writeGroupRow(groupAggregators, buffer); groupAggregators.reset(); } }
@Override public void processBatch(VectorizedRowBatch batch) throws HiveException { for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(aggregationBuffers.getAggregationBuffer(i), batch); } }
@Override public void processBatch(VectorizedRowBatch batch) throws HiveException { assert(inGroup); if (first) { // Copy the group key to output batch now. We'll copy in the aggregates at the end of the group. first = false; groupKeyHelper.copyGroupKey(batch, outputBatch, buffer); } // Aggregate this batch. for (int i = 0; i < aggregators.length; ++i) { aggregators[i].aggregateInput(groupAggregators.getAggregationBuffer(i), batch); } }