You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/05/24 20:24:01 UTC

[GitHub] [arrow-nanoarrow] lidavidm commented on a diff in pull request #201: refactor: Unify `ArrowArrayView` and `ArrowArray` validation

lidavidm commented on code in PR #201:
URL: https://github.com/apache/arrow-nanoarrow/pull/201#discussion_r1204723524


##########
src/nanoarrow/array.c:
##########
@@ -296,6 +296,16 @@ static ArrowErrorCode ArrowArrayViewInitFromArray(struct ArrowArrayView* array_v
   ArrowArrayViewInitFromType(array_view, private_data->storage_type);
   array_view->layout = private_data->layout;
   array_view->array = array;
+  array_view->length = array->length;
+  array_view->offset = array->offset;
+  array_view->null_count = array->null_count;

Review Comment:
   Ah, so is this an additional offset, or is it supposed to replace the array's offset?



##########
src/nanoarrow/array_inline.h:
##########
@@ -654,7 +654,7 @@ static inline void ArrowArrayViewMove(struct ArrowArrayView* src,
 
 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;
+  i += array_view->offset;

Review Comment:
   From the docstring, shouldn't we _also_ add ArrowArray->offset if the array is set?



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