Skip to content

Commit

Permalink
If rowId out range it points to NULL
Browse files Browse the repository at this point in the history
Signed-off-by: Gera Shegalov <gera@apache.org>
  • Loading branch information
gerashegalov committed May 3, 2022
1 parent a9eb47c commit b350219
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions java/src/main/java/ai/rapids/cudf/HostColumnVectorCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,8 @@ public HostColumnVector.StructData getStruct(int rowIndex) {
* @return true if null else false
*/
public boolean isNull(long rowIndex) {
assert (rowIndex >= 0 && rowIndex < rows) : "index is out of range 0 <= " + rowIndex + " < " + rows;
if (hasValidityVector()) {
return BitVectorHelper.isNull(offHeap.valid, rowIndex);
}
return false;
return rowIndex < 0 || rowIndex >= rows // unknown, hence NULL
|| hasValidityVector() && BitVectorHelper.isNull(offHeap.valid, rowIndex);
}

/**
Expand Down

0 comments on commit b350219

Please sign in to comment.