Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
public class BufferedVectorizedRowBatch extends VectorizedRowBatch {
boolean isLastGroupBatch;
boolean isInputExpressionEvaluated;

public BufferedVectorizedRowBatch(int numCols) {
super(numCols);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ public void setNullsLast(boolean nullsLast) {
this.nullsLast = nullsLast;
}

// Evaluate the aggregation input argument expression.
public void evaluateInputExpr(VectorizedRowBatch batch) throws HiveException {
if (inputVecExpr != null) {
inputVecExpr.evaluate(batch);
}
}

/*
* Evaluate the aggregation over one of the group's batches. In this mode, evaluator is not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public VectorPTFEvaluatorCount(WindowFrameDef windowFrameDef, VectorExpression i
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Count non-null column rows.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public VectorPTFEvaluatorCountDistinct(WindowFrameDef windowFrameDef,
@Override
public void evaluateGroupBatch(VectorizedRowBatch batch) throws HiveException {

evaluateInputExpr(batch);

// We do not filter when PTF is in reducer.
Preconditions.checkState(!batch.selectedInUse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public VectorPTFEvaluatorCountStar(WindowFrameDef windowFrameDef, VectorExpressi
@Override
public void evaluateGroupBatch(VectorizedRowBatch batch) {
// No input expression for COUNT(*).
// evaluateInputExpr(batch);

// Count all rows.
count += batch.size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public VectorPTFEvaluatorDecimalAvg(WindowFrameDef windowFrameDef, VectorExpress
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null decimal column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public VectorPTFEvaluatorDecimalFirstValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// First row determines isGroupResultNull and decimal firstValue; stream fill result as repeated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public VectorPTFEvaluatorDecimalLastValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Last row of last batch determines isGroupResultNull and decimal lastValue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorDecimalMax(WindowFrameDef windowFrameDef, VectorExpress
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null decimal column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public VectorPTFEvaluatorDecimalMin(WindowFrameDef windowFrameDef, VectorExpress
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null decimal column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorDecimalSum(WindowFrameDef windowFrameDef, VectorExpress
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null decimal column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public VectorPTFEvaluatorDoubleAvg(WindowFrameDef windowFrameDef, VectorExpressi
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null double column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public VectorPTFEvaluatorDoubleFirstValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// First row determines isGroupResultNull and double firstValue; stream fill result as repeated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public VectorPTFEvaluatorDoubleLastValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Last row of last batch determines isGroupResultNull and double lastValue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorDoubleMax(WindowFrameDef windowFrameDef, VectorExpressi
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null double column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorDoubleMin(WindowFrameDef windowFrameDef, VectorExpressi
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null double column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public VectorPTFEvaluatorDoubleSum(WindowFrameDef windowFrameDef, VectorExpressi
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null double column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Object runOnRange(int rowNum, Range range, VectorPTFGroupBatches batches)
if (lagRow < 0 || lagRow >= batches.size()) {
return getDefaultValue(rowNum, batches);
} else {
return batches.getValueAndEvaluateInputExpression(this, lagRow, inputColumnNum);
return batches.getValue(lagRow, inputColumnNum);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Object runOnRange(int rowNum, Range range, VectorPTFGroupBatches batches)
if (leadRow < 0 || leadRow >= batches.size()) {
return getDefaultValue(rowNum, batches);
} else {
return batches.getValueAndEvaluateInputExpression(this, leadRow, inputColumnNum);
return batches.getValue(leadRow, inputColumnNum);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public VectorPTFEvaluatorLongAvg(WindowFrameDef windowFrameDef, VectorExpression
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null long column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public VectorPTFEvaluatorLongFirstValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// First row determines isGroupResultNull and long firstValue; stream fill result as repeated.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorLongLastValue(WindowFrameDef windowFrameDef,
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Last row of last batch determines isGroupResultNull and long lastValue.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorLongMax(WindowFrameDef windowFrameDef, VectorExpression
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null long column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorLongMin(WindowFrameDef windowFrameDef, VectorExpression
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null long column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public VectorPTFEvaluatorLongSum(WindowFrameDef windowFrameDef, VectorExpression
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null long column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public VectorPTFEvaluatorRowNumber(WindowFrameDef windowFrameDef, VectorExpressi
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

final int size = batch.size;
LongColumnVector longColVector = (LongColumnVector) batch.cols[outputColumnNum];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public VectorPTFEvaluatorStreamingDecimalAvg(WindowFrameDef windowFrameDef, Vect
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null decimal column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorStreamingDecimalMax(WindowFrameDef windowFrameDef, Vect
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null decimal column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorStreamingDecimalMin(WindowFrameDef windowFrameDef, Vect
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null decimal column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public VectorPTFEvaluatorStreamingDecimalSum(WindowFrameDef windowFrameDef, Vect
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null decimal column values; maintain isGroupResultNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public VectorPTFEvaluatorStreamingDoubleAvg(WindowFrameDef windowFrameDef, Vecto
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null double column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingDoubleMax(WindowFrameDef windowFrameDef, Vecto
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null double column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingDoubleMin(WindowFrameDef windowFrameDef, Vecto
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null double column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingDoubleSum(WindowFrameDef windowFrameDef, Vecto
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// We do not filter when PTF is in reducer.
Preconditions.checkState(!batch.selectedInUse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public VectorPTFEvaluatorStreamingLongAvg(WindowFrameDef windowFrameDef, VectorE
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null long column values for avg; maintain isGroupResultNull; after last row of
// last group batch compute the group avg when sum is non-null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingLongMax(WindowFrameDef windowFrameDef, VectorE
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine maximum of all non-null long column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingLongMin(WindowFrameDef windowFrameDef, VectorE
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Determine minimum of all non-null long column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public VectorPTFEvaluatorStreamingLongSum(WindowFrameDef windowFrameDef, VectorE
public void evaluateGroupBatch(VectorizedRowBatch batch)
throws HiveException {

evaluateInputExpr(batch);

// Sum all non-null long column values; maintain isNull.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,6 @@ public Object getValue(int row, int col) throws HiveException {
return getValueFromBatch(bufferedBatches.get(rp.batchIndex), col, rp.rowIndexInBatch);
}

public Object getValueAndEvaluateInputExpression(VectorPTFEvaluatorBase evaluator, int row,
int col) throws HiveException {
RowPositionInBatch rp = getPosition(row);
BufferedVectorizedRowBatch batch = bufferedBatches.get(rp.batchIndex);
if (!batch.isInputExpressionEvaluated) {
evaluator.evaluateInputExpr(batch);
}
return getValueFromBatch(batch, col, rp.rowIndexInBatch);
}

public RowPositionInBatch getPosition(int i) throws HiveException {
if (positionCache[i] != null) {
Expand Down Expand Up @@ -997,7 +988,6 @@ private VectorizedRowBatch createTruncatedBufferedBatch(BufferedVectorizedRowBat

partialBatch.size = size;
partialBatch.isLastGroupBatch = bufferedBatch.isLastGroupBatch;
partialBatch.isInputExpressionEvaluated = bufferedBatch.isInputExpressionEvaluated;
return partialBatch;
}

Expand Down Expand Up @@ -1159,7 +1149,6 @@ private void readBlockFromSpillToMemory(VectorSpillBlock block) throws HiveExcep
block.readSingleRowFromBytesContainer(bufferedBatch);
bufferedBatch.size += 1;
bufferedBatch.isLastGroupBatch = block.isLastGroupBatch[batchIndex];
bufferedBatch.isInputExpressionEvaluated = block.isInputExpressionEvaluated[batchIndex];
}
currentBufferedBatchCount = block.spillBatchCount;
partitionMetrics.batchesReadFromSpill += currentBufferedBatchCount;
Expand Down Expand Up @@ -1187,7 +1176,6 @@ private void spillAndResetCurrentBufferedBatches() throws HiveException {
BufferedVectorizedRowBatch bufferedBatch = bufferedBatches.get(i);
block.spillBatch(bufferedBatch);
block.isLastGroupBatch[i] = bufferedBatch.isLastGroupBatch;
block.isInputExpressionEvaluated[i] = bufferedBatch.isInputExpressionEvaluated;
block.spillRowCount += bufferedBatch.size;
block.spillBatchCount += 1;
if (previousBatch != null) {
Expand Down
Loading
Loading