paleolimbot / nanoarrow

Helpers for Arrow C Data & Arrow C Stream interfaces
4 stars 0 forks source link

Implement `ArrowArray*` helpers #13

Open paleolimbot opened 2 years ago

paleolimbot commented 2 years ago

Now that we have buffer holders (struct ArrowBuffer) we can implement an owning struct ArrowArray. I envision the API something like the ArrowSchema* helpers:

lidavidm commented 2 years ago

Maybe Init could take the type and then it would know how many buffers to allocate? (Ditto for AllocateChildren)

paleolimbot commented 2 years ago

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