Skip to content

Commit 16c9e2f

Browse files
committed
comment
1 parent b431cf0 commit 16c9e2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vector/src/main/java/org/apache/arrow/vector/BaseVariableWidthViewVector.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,8 +1368,8 @@ protected final void setBytes(int index, byte[] value, int start, int length) {
13681368
int writePosition = index * ELEMENT_SIZE;
13691369

13701370
if (length <= INLINE_SIZE) {
1371-
// to clear the memory segment of view being written to
1372-
// if it has been set
1371+
// Check if the memory segment has been written, and clear it if it has been set.
1372+
// It is recommended to batch initialize the viewBuffer before setBytes.
13731373
if (viewBuffer.getLong(writePosition) != 0 || viewBuffer.getLong(writePosition + 8) != 0) {
13741374
viewBuffer.setZero(writePosition, ELEMENT_SIZE);
13751375
}
@@ -1414,8 +1414,8 @@ protected final void setBytes(int index, ArrowBuf valueBuf, int start, int lengt
14141414
int writePosition = index * ELEMENT_SIZE;
14151415

14161416
if (length <= INLINE_SIZE) {
1417-
// to clear the memory segment of view being written to
1418-
// if it has been set
1417+
// Check if the memory segment has been written, and clear it if it has been set.
1418+
// It is recommended to batch initialize the viewBuffer before setBytes.
14191419
if (viewBuffer.getLong(writePosition) != 0 || viewBuffer.getLong(writePosition + 8) != 0) {
14201420
viewBuffer.setZero(writePosition, ELEMENT_SIZE);
14211421
}

0 commit comments

Comments
 (0)