lidavidm commented on issue #36443:
URL: https://github.com/apache/arrow/issues/36443#issuecomment-1688296978
It would generally look like
```java
try (final ArrowRecordBatch batch = ...) {
exportBatch(batch); // increments reference count
}
// batch is not freed here unless exportBatch threw (but reference count is
decreased)
// when Python frees the arrow::RecordBatch, the C Data callback will
// decrement the reference count and actually free the batch
```
The only problem is the lifetime of the `BufferAllocator` which isn't
solvable in C Data Interface; either the Java application needs to have a
singleton allocator or (preferably) it should tie the lifetime of the allocator
to something else (e.g. an init/finalize call, or if the Java application
implements a reader or some other object, it should tie the allocator to that
object)
--
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]