eddelbuettel opened a new issue, #156:
URL: https://github.com/apache/arrow-nanoarrow/issues/156
When retrieving data column by column we may want to bundle in a Table or
RecordBatch. I am currenly this:
```c++
ArrowSchemaInitFromType((ArrowSchema*)R_ExternalPtrAddr(schemaxp),
NANOARROW_TYPE_STRUCT);
ArrowSchemaAllocateChildren((ArrowSchema*)R_ExternalPtrAddr(schemaxp),
ncol);
ArrowArrayInitFromType((ArrowArray*)R_ExternalPtrAddr(arrayxp),
NANOARROW_TYPE_STRUCT);
ArrowArrayAllocateChildren((ArrowArray*)R_ExternalPtrAddr(arrayxp), ncol);
arrayxp->length = 0; // just a baseline init here
for (size_t i=0; i<ncol; i++) {
// some stuff omitted here, fills object 'pp' that is pair with two
pointers to the structs
if (pp.first->length > arrayxp->length) {
arrayxp->length = pp.first->length;
}
}
```
and the setting of the length of the data in the 'children' does not seem to
have a setter in the API -- which is not deadly as one can do it manually as I
do here. But it could be an oversight, or maybe it exists and I missed it.
There is of course also an implicit issue here that someone (the user?) may
want to check that the length of the children is consistent. I have not
thought too hard about how it could fit into the existing API -- maybe as a
finalizing step? Or again, maybe it is there and I missed it -- if so my bad.
--
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]