You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/22 14:42:50 UTC

[GitHub] [arrow-nanoarrow] paleolimbot commented on a diff in pull request #26: Implement getters

paleolimbot commented on code in PR #26:
URL: https://github.com/apache/arrow-nanoarrow/pull/26#discussion_r951528163


##########
src/nanoarrow/array_inline.h:
##########
@@ -445,6 +445,179 @@ static inline ArrowErrorCode ArrowArrayFinishElement(struct ArrowArray* array) {
   return NANOARROW_OK;
 }
 
+static inline int8_t ArrowArrayViewIsNull(struct ArrowArrayView* array_view, int64_t i) {
+  const uint8_t* validity_buffer = array_view->buffer_views[0].data.as_uint8;
+  i += array_view->array->offset;
+  switch (array_view->storage_type) {
+    case NANOARROW_TYPE_NA:
+      return 0x01;
+    case NANOARROW_TYPE_DENSE_UNION:
+    case NANOARROW_TYPE_SPARSE_UNION:
+      // Not supported yet
+      return 0xff;

Review Comment:
   Isn't the nullness determined by each sub-array? (i.e., the "right" way to do it would be `ArrowArrayViewIsNull(array_view->children[array_view->buffer_view[0].data.as_int8[i]], i)` for the sparse version)?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org