code: public static int[] toJavaIntArray(ColumnarArray array) {
      for (int i = 0; i < array.numElements(); i++) {
        if (array.isNullAt(i)) {
          throw new RuntimeException("Cannot handle NULL values.");
        }
      }
      return array.toIntArray();
    }
docs: Returns the array data as the java primitive array.
  For example, an array of IntegerType will return an int[].
  Throws exceptions for unhandled schemas.