use of org.apache.hadoop.hive.ql.exec.vector.ColumnVector in project hive by apache.
the class VectorUDAFBloomFilter method aggregateInput.
@Override
public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException {
inputExpression.evaluate(batch);
ColumnVector inputColumn = batch.cols[this.inputExpression.getOutputColumn()];
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
Aggregation myagg = (Aggregation) agg;
if (inputColumn.isRepeating) {
if (inputColumn.noNulls) {
valueProcessor.processValue(myagg, inputColumn, 0);
}
return;
}
if (!batch.selectedInUse && inputColumn.noNulls) {
iterateNoSelectionNoNulls(myagg, inputColumn, batchSize);
} else if (!batch.selectedInUse) {
iterateNoSelectionHasNulls(myagg, inputColumn, batchSize);
} else if (inputColumn.noNulls) {
iterateSelectionNoNulls(myagg, inputColumn, batchSize, batch.selected);
} else {
iterateSelectionHasNulls(myagg, inputColumn, batchSize, batch.selected);
}
}
use of org.apache.hadoop.hive.ql.exec.vector.ColumnVector in project hive by apache.
the class VectorUDAFBloomFilter method aggregateInputSelection.
@Override
public void aggregateInputSelection(VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, VectorizedRowBatch batch) throws HiveException {
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
inputExpression.evaluate(batch);
ColumnVector inputColumn = batch.cols[this.inputExpression.getOutputColumn()];
if (inputColumn.noNulls) {
if (inputColumn.isRepeating) {
iterateNoNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
} else {
if (batch.selectedInUse) {
iterateNoNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batch.selected, batchSize);
} else {
iterateNoNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
}
}
} else {
if (inputColumn.isRepeating) {
// All nulls, no-op for min/max
} else {
if (batch.selectedInUse) {
iterateHasNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize, batch.selected);
} else {
iterateHasNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
}
}
}
}
use of org.apache.hadoop.hive.ql.exec.vector.ColumnVector in project hive by apache.
the class VectorUDAFBloomFilterMerge method aggregateInput.
@Override
public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException {
inputExpression.evaluate(batch);
ColumnVector inputColumn = batch.cols[this.inputExpression.getOutputColumn()];
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
Aggregation myagg = (Aggregation) agg;
if (inputColumn.isRepeating) {
if (inputColumn.noNulls) {
processValue(myagg, inputColumn, 0);
}
return;
}
if (!batch.selectedInUse && inputColumn.noNulls) {
iterateNoSelectionNoNulls(myagg, inputColumn, batchSize);
} else if (!batch.selectedInUse) {
iterateNoSelectionHasNulls(myagg, inputColumn, batchSize);
} else if (inputColumn.noNulls) {
iterateSelectionNoNulls(myagg, inputColumn, batchSize, batch.selected);
} else {
iterateSelectionHasNulls(myagg, inputColumn, batchSize, batch.selected);
}
}
use of org.apache.hadoop.hive.ql.exec.vector.ColumnVector in project hive by apache.
the class VectorUDAFBloomFilterMerge method aggregateInputSelection.
@Override
public void aggregateInputSelection(VectorAggregationBufferRow[] aggregationBufferSets, int aggregateIndex, VectorizedRowBatch batch) throws HiveException {
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
inputExpression.evaluate(batch);
ColumnVector inputColumn = batch.cols[this.inputExpression.getOutputColumn()];
if (inputColumn.noNulls) {
if (inputColumn.isRepeating) {
iterateNoNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
} else {
if (batch.selectedInUse) {
iterateNoNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batch.selected, batchSize);
} else {
iterateNoNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
}
}
} else {
if (inputColumn.isRepeating) {
// All nulls, no-op for min/max
} else {
if (batch.selectedInUse) {
iterateHasNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize, batch.selected);
} else {
iterateHasNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, inputColumn, batchSize);
}
}
}
}
use of org.apache.hadoop.hive.ql.exec.vector.ColumnVector in project hive by apache.
the class VectorUDAFCount method aggregateInputSelection.
@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);
}
}
Aggregations