paleolimbot opened a new issue, #5:
URL: https://github.com/apache/arrow-nanoarrow/issues/5

   Now that we have buffer holders (`struct ArrowBuffer`) we can implement an 
owning `struct ArrowArray`. I envision the API something like the 
`ArrowSchema*` helpers:
   
   - `ArrowArrayInit(struct ArrowArray* array, int64_t n_buffers)`
   - `ArrowArrayAllocateChildren(struct ArrowArray* array, int64_t n_children)`
   - `ArrowArraySetBuffer(struct ArrowArray* array, int64_t i, struct 
ArrowBuffer* buffer)` (moves the `struct ArrowBuffer` so that it lives in 
memory owned by `array->private_data` and sets `array->buffers[i] = 
buffer->data`).
   
   @lidavidm commented:
   
   Maybe `Init` could take the type and then it would know how many buffers to 
allocate? (Ditto for `AllocateChildren`)
   
   @paleolimbot commented:
   
   Ah that makes sense, and parallels `ArrowSchemaInit()` (where the caller can 
fall back on `NANOARROW_TYPE_UNINITIALIZED` if they're implementing their own 
logic). I think `ArrowArrayAllocateChildren()` has to exist on its own, but the 
utility of a helper like `ArrowArrayInitFromSchemaView(struct ArrowArray* 
array, struct ArrowSchemaView* view, struct ArrowError* error)` might become 
clear at some point (since the schema view contains all the information needed 
to initialize all the buffers for all the recursive children).


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

Reply via email to