public abstract class VectorPTFEvaluatorAbstractAvg<T> extends VectorPTFEvaluatorBase
Modifier and Type | Field and Description |
---|---|
protected boolean |
isGroupResultNull |
protected int |
nonNullGroupCount |
protected int |
previousCount |
protected Range |
previousRange |
protected T |
previousSum |
protected T |
sum |
inputColumnNum, LOG, outputColumnNum
Constructor and Description |
---|
VectorPTFEvaluatorAbstractAvg(WindowFrameDef windowFrameDef,
VectorExpression inputVecExpr,
int outputColumnNum) |
Modifier and Type | Method and Description |
---|---|
boolean |
canRunOptimizedCalculation(int rowNum,
Range range)
Whether the evaluator can calculate the result for a given range.
|
protected abstract T |
computeValue(T number) |
protected abstract Object |
divide(T number,
long divisor) |
boolean |
isGroupResultNull() |
protected abstract T |
minus(T number1,
T number2) |
void |
onPartitionEnd()
There might be some cleanup operations for evaluators that should not be taken care of after
every row (resetEvaluator), but rather on partition-level.
|
void |
onResultCalculated(Object result,
Range range)
This method is called by VectorPTFGroupBatches once the calculation is finished for a given
row/range, but before the next calculation is invoked.
|
protected abstract T |
plus(T number1,
T number2) |
Object |
runOnRange(int rowNum,
Range range,
VectorPTFGroupBatches batches)
This optimization is the vectorized counterpart of HIVE-15617.
|
boolean |
streamsResult() |
doLastBatchWork, evaluateGroupBatch, evaluateInputExpr, getGroupResult, getNullsLast, getOutputColumnNum, getResultColumnVectorType, isCacheableForRange, mapCustomColumns, resetEvaluator, setNullsLast
protected boolean isGroupResultNull
protected T sum
protected int nonNullGroupCount
protected Range previousRange
protected T previousSum
protected int previousCount
public VectorPTFEvaluatorAbstractAvg(WindowFrameDef windowFrameDef, VectorExpression inputVecExpr, int outputColumnNum)
public boolean canRunOptimizedCalculation(int rowNum, Range range)
VectorPTFEvaluatorBase
canRunOptimizedCalculation
in class VectorPTFEvaluatorBase
public Object runOnRange(int rowNum, Range range, VectorPTFGroupBatches batches) throws HiveException
runOnRange
in class VectorPTFEvaluatorBase
HiveException
public void onResultCalculated(Object result, Range range)
VectorPTFEvaluatorBase
onResultCalculated
in class VectorPTFEvaluatorBase
public void onPartitionEnd()
VectorPTFEvaluatorBase
onPartitionEnd
in class VectorPTFEvaluatorBase
public boolean streamsResult()
streamsResult
in class VectorPTFEvaluatorBase
public boolean isGroupResultNull()
isGroupResultNull
in class VectorPTFEvaluatorBase
Copyright © 2023 The Apache Software Foundation. All rights reserved.