joyCurry30 commented on code in PR #454:
URL: https://github.com/apache/arrow-java/pull/454#discussion_r1903517996


##########
vector/src/test/java/org/apache/arrow/vector/testing/ValueVectorDataPopulator.java:
##########
@@ -606,6 +607,18 @@ public static void setVector(VarCharVector vector, 
String... values) {
     vector.setValueCount(length);
   }
 
+  /** Populate values for ViewVarCharVector. */
+  public static void setVector(ViewVarCharVector vector, String... values) {
+    final int length = values.length;
+    vector.allocateNewSafe();
+    for (int i = 0; i < length; i++) {
+      if (values[i] != null) {
+        vector.setSafe(i, values[i].getBytes(StandardCharsets.UTF_8));
+      }
+    }
+    vector.setValueCount(length);

Review Comment:
   What if the passed parameter “values” is null or an empty queue? 



##########
vector/src/test/java/org/apache/arrow/vector/testing/ValueVectorDataPopulator.java:
##########
@@ -606,6 +607,18 @@ public static void setVector(VarCharVector vector, 
String... values) {
     vector.setValueCount(length);
   }
 
+  /** Populate values for ViewVarCharVector. */
+  public static void setVector(ViewVarCharVector vector, String... values) {
+    final int length = values.length;
+    vector.allocateNewSafe();
+    for (int i = 0; i < length; i++) {
+      if (values[i] != null) {
+        vector.setSafe(i, values[i].getBytes(StandardCharsets.UTF_8));
+      }
+    }
+    vector.setValueCount(length);

Review Comment:
   What if the passed parameter “values” is null or an empty queue? 



-- 
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]

Reply via email to