lwhite1 commented on code in PR #14289:
URL: https://github.com/apache/arrow/pull/14289#discussion_r985726660


##########
java/vector/src/main/java/org/apache/arrow/vector/GenerateSampleData.java:
##########
@@ -267,6 +275,58 @@ private static void writeTinyIntData(TinyIntVector vector, 
int valueCount) {
     vector.setValueCount(valueCount);
   }
 
+  private static void writeUInt1Data(UInt1Vector vector, int valueCount) {
+    final byte even = 1;
+    final byte odd = 2;
+    for (int i = 0; i < valueCount; i++) {
+      if (i % 2 == 0) {
+        vector.setSafe(i, even);
+      } else {
+        vector.setSafe(i, odd);
+      }
+    }
+    vector.setValueCount(valueCount);
+  }
+
+  private static void writeUInt2Data(UInt2Vector vector, int valueCount) {
+    final short even = 10;
+    final short odd = 20;
+    for (int i = 0; i < valueCount; i++) {
+      if (i % 2 == 0) {
+        vector.setSafe(i, even);
+      } else {
+        vector.setSafe(i, odd);
+      }
+    }
+    vector.setValueCount(valueCount);
+  }
+
+  private static void writeUInt4Data(UInt4Vector vector, int valueCount) {
+    final int even = 1000;
+    final int odd = 2000;
+    for (int i = 0; i < valueCount; i++) {
+      if (i % 2 == 0) {
+        vector.setSafe(i, even);
+      } else {
+        vector.setSafe(i, odd);
+      }
+    }
+    vector.setValueCount(valueCount);
+  }
+
+  private static void writeUInt8Data(UInt8Vector vector, int valueCount) {
+    final long even = 1000000000;
+    final long odd = 2000000000;

Review Comment:
   The UInts are all represented as ints under the covers in java (except UInt2 
may be a char). I don't know of any way to to create a value like you're 
suggesting, and I think it would error if I did so it couldn't be used for test 
data. 



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