pan3793 commented on a change in pull request #2102:
URL: https://github.com/apache/iceberg/pull/2102#discussion_r559273066



##########
File path: core/src/main/java/org/apache/iceberg/util/ArrayUtil.java
##########
@@ -59,4 +68,221 @@ private ArrayUtil() {
       return null;
     }
   }
+
+  /**
+   * <p>Converts an array of object Booleans to primitives.
+   *
+   * <p>This method returns {@code null} for a {@code null} input array.
+   *
+   * @param array  a {@code Boolean} array, may be {@code null}
+   * @return a {@code boolean} array, {@code null} if null array input
+   * @throws NullPointerException if array content is {@code null}
+   */
+  public static boolean[] toPrimitive(final Boolean[] array) {
+    if (array == null) {
+      return null;
+    } else if (array.length == 0) {
+      return EMPTY_BOOLEAN_ARRAY;
+    }
+    final boolean[] result = new boolean[array.length];
+    for (int i = 0; i < array.length; i++) {
+      result[i] = array[i].booleanValue();
+    }
+    return result;
+  }

Review comment:
       Thanks for review. Updated the comments.




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to