ryukobayashi commented on code in PR #6486:
URL: https://github.com/apache/hive/pull/6486#discussion_r3279624077
##########
storage-api/src/test/org/apache/hadoop/hive/ql/exec/vector/TestBytesColumnVector.java:
##########
@@ -220,4 +222,21 @@ private static byte[] writeToBytesColumnVector(int rowIdx,
BytesColumnVector col
col.setValPreallocated(rowIdx, writeSize);
return bytes;
}
+
+ @Test
+ public void testClearValue() {
+ BytesColumnVector cv = new BytesColumnVector(4);
+ byte[] data = "hello".getBytes(StandardCharsets.UTF_8);
+ cv.vector[0] = data;
+ cv.start[0] = 1;
+ cv.length[0] = 3;
+
+ cv.clearValue(0);
+
+ assertTrue(cv.isNull[0]);
+ assertFalse(cv.noNulls);
+ assertNull(cv.vector[0]);
+ assertEquals(0, cv.start[0]);
+ assertEquals(0, cv.length[0]);
+ }
Review Comment:
Added pre-loaded data to the neighboring slot (index 1) and asserted after
clearValue(0) that its vector, start, length, and isNull are all unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]