tom-s-powell commented on code in PR #12692:
URL: https://github.com/apache/arrow/pull/12692#discussion_r886027586


##########
java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java:
##########
@@ -378,4 +393,25 @@ public static String[] getValues(String[] values, String 
dataType) {
     }
     return value.split(",");
   }
+
+  public static Integer[][] getListValues(String[] values, String dataType) {
+    String[] dataArr = getValues(values, dataType);
+    Integer[][] valueArr = new Integer[dataArr.length][];
+    int i = 0;
+    for (String data : dataArr) {
+      if ("null".equals(data.trim())) {
+        valueArr[i++] = null;
+      } else if ("()".equals(data.trim())) {
+        valueArr[i++] = new Integer[0];
+      } else {
+        String[] row = data.replace("(", "").replace(")", "").split(";");
+        Integer[] arr = new Integer[row.length];
+        for (int j = 0; j < arr.length; j++) {
+          arr[j] = "null".equals(row[j]) ? null : Integer.parseInt(row[j]);
+        }
+        valueArr[i++] = arr;
+      }
+    }
+    return valueArr;
+  }

Review Comment:
   Refactored so they can be reused



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