Skip to content
Open
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 @@ -27,7 +27,10 @@
import org.apache.hadoop.hive.ql.exec.persistence.MapJoinTableContainer;
import org.apache.hadoop.hive.ql.exec.vector.BytesColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.ColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.DoubleColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.IntervalDayTimeColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.LongColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.TimestampColumnVector;
import org.apache.hadoop.hive.ql.exec.vector.VectorizationContext;
import org.apache.hadoop.hive.ql.exec.vector.VectorizedRowBatch;
import org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression;
Expand Down Expand Up @@ -590,13 +593,15 @@ protected void generateOuterNulls(VectorizedRowBatch batch, int[] noMatchs,
ColumnVector colVector = batch.cols[column];
colVector.noNulls = false;
colVector.isNull[batchIndex] = true;
clearVectorValue(colVector, batchIndex);
}

// Small table values are set to null.
for (int column : smallTableValueColumnMap) {
ColumnVector colVector = batch.cols[column];
colVector.noNulls = false;
colVector.isNull[batchIndex] = true;
clearVectorValue(colVector, batchIndex);
}
}
}
Expand Down Expand Up @@ -749,13 +754,32 @@ protected void generateOuterNullsRepeatedAll(VectorizedRowBatch batch) throws Hi
colVector.noNulls = false;
colVector.isNull[0] = true;
colVector.isRepeating = true;
clearVectorValue(colVector, 0);
}

for (int column : smallTableValueColumnMap) {
ColumnVector colVector = batch.cols[column];
colVector.noNulls = false;
colVector.isNull[0] = true;
colVector.isRepeating = true;
clearVectorValue(colVector, 0);
}
}

private static void clearVectorValue(ColumnVector colVector, int index) {
if (colVector instanceof LongColumnVector) {
((LongColumnVector) colVector).vector[index] = 0L;
} else if (colVector instanceof DoubleColumnVector) {
((DoubleColumnVector) colVector).vector[index] = 0.0;
} else if (colVector instanceof BytesColumnVector) {
BytesColumnVector bcv = (BytesColumnVector) colVector;
bcv.vector[index] = null;
bcv.start[index] = 0;
bcv.length[index] = 0;
} else if (colVector instanceof TimestampColumnVector) {
((TimestampColumnVector) colVector).setNullValue(index);
} else if (colVector instanceof IntervalDayTimeColumnVector) {
((IntervalDayTimeColumnVector) colVector).setNullValue(index);
Comment on lines +769 to +782
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please confirm that these are the only ColumnVectors that can appear in smallTableValueColumnMap and outerSmallTableKeyColumnMap?
Maybe we should do the same for all ColumnVector types, and it would be better to do this in the individual classes instead of handling it here.

}
}

Expand Down
Loading