use of org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector in project hive by apache.
the class VectorUDAFSumDecimal64ToDecimal method aggregateInput.
@Override
public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException {
inputExpression.evaluate(batch);
Decimal64ColumnVector inputVector = (Decimal64ColumnVector) batch.cols[this.inputExpression.getOutputColumnNum()];
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
Aggregation myagg = (Aggregation) agg;
long[] vector = inputVector.vector;
if (inputVector.isRepeating) {
if (inputVector.noNulls || !inputVector.isNull[0]) {
if (myagg.isNull) {
myagg.isNull = false;
myagg.sum = 0;
}
myagg.sumValueNoCheck(vector[0] * 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);
}
}
use of org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector in project hive by apache.
the class VectorUDAFSumDecimal64ToDecimal 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);
Decimal64ColumnVector inputVector = (Decimal64ColumnVector) batch.cols[this.inputExpression.getOutputColumnNum()];
long[] vector = inputVector.vector;
if (inputVector.noNulls) {
if (inputVector.isRepeating) {
iterateNoNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector[0], batchSize);
} else {
if (batch.selectedInUse) {
iterateNoNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batch.selected, batchSize);
} else {
iterateNoNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize);
}
}
} else {
if (inputVector.isRepeating) {
iterateHasNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector[0], batchSize, inputVector.isNull);
} else {
if (batch.selectedInUse) {
iterateHasNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize, batch.selected, inputVector.isNull);
} else {
iterateHasNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize, inputVector.isNull);
}
}
}
}
use of org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector in project hive by apache.
the class VectorUDAFSumDecimal64 method aggregateInput.
@Override
public void aggregateInput(AggregationBuffer agg, VectorizedRowBatch batch) throws HiveException {
inputExpression.evaluate(batch);
Decimal64ColumnVector inputVector = (Decimal64ColumnVector) batch.cols[this.inputExpression.getOutputColumnNum()];
int batchSize = batch.size;
if (batchSize == 0) {
return;
}
Aggregation myagg = (Aggregation) agg;
long[] vector = inputVector.vector;
if (inputVector.isRepeating) {
if (inputVector.noNulls || !inputVector.isNull[0]) {
if (myagg.isNull) {
myagg.isNull = false;
myagg.sum = 0;
}
myagg.sumValueNoNullCheck(vector[0] * 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);
}
}
use of org.apache.hadoop.hive.ql.exec.vector.Decimal64ColumnVector in project hive by apache.
the class VectorUDAFSumDecimal64 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);
Decimal64ColumnVector inputVector = (Decimal64ColumnVector) batch.cols[this.inputExpression.getOutputColumnNum()];
long[] vector = inputVector.vector;
if (inputVector.noNulls) {
if (inputVector.isRepeating) {
iterateNoNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector[0], batchSize);
} else {
if (batch.selectedInUse) {
iterateNoNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batch.selected, batchSize);
} else {
iterateNoNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize);
}
}
} else {
if (inputVector.isRepeating) {
iterateHasNullsRepeatingWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector[0], batchSize, inputVector.isNull);
} else {
if (batch.selectedInUse) {
iterateHasNullsSelectionWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize, batch.selected, inputVector.isNull);
} else {
iterateHasNullsWithAggregationSelection(aggregationBufferSets, aggregateIndex, vector, batchSize, inputVector.isNull);
}
}
}
}
Aggregations