WillAyd commented on code in PR #596:
URL: https://github.com/apache/arrow-nanoarrow/pull/596#discussion_r1729435252
##########
src/nanoarrow/common/inline_array.h:
##########
@@ -938,6 +954,22 @@ static inline struct ArrowStringView
ArrowArrayViewGetStringUnsafe(
view.size_bytes = array_view->layout.element_size_bits[1] / 8;
view.data = array_view->buffer_views[1].data.as_char + (i *
view.size_bytes);
break;
+ case NANOARROW_TYPE_STRING_VIEW:
+ case NANOARROW_TYPE_BINARY_VIEW: {
+ const union ArrowBufferViewData value_view =
array_view->buffer_views[1].data;
+ union ArrowBinaryViewType bvt;
+ const size_t idx = sizeof(union ArrowBinaryViewType) * i;
+ memcpy(&bvt, value_view.as_uint8 + idx, sizeof(union
ArrowBinaryViewType));
+ const int32_t inline_size = bvt.inlined.size;
+ view.size_bytes = inline_size;
+ if (inline_size <= ARROW_VIEW_INLINE_SIZE) {
+ view.data = value_view.as_char + idx + sizeof(int32_t);
+ } else {
+ const int32_t buf_index = bvt.ref.buffer_index + 2;
Review Comment:
This isn't working at the moment. The inline data seems to work, but for the
non-inline values the extra buffer points come back as null
I assume something has to be changed to accommodate this in or around
`ArrowArrayViewSetArrayInternal`
--
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]