arrow icon indicating copy to clipboard operation
arrow copied to clipboard

GH-43631: [C++] Add C++ implementation of Async C Data Interface

Open zeroshade opened this issue 1 year ago • 0 comments

Rationale for this change

Building on #43632 which created the Async C Data Structures, this adds functions to bridge.h/bridge.cc to implement helpers for managing the Async C Data interfaces

What changes are included in this PR?

Two functions added to bridge.h:

  1. CreateAsyncDeviceStreamHandler populates a ArrowAsyncDeviceStreamHandler and an Executor to provide a future that resolves to an AsyncRecordBatchGenerator to produce record batches as they are pushed asynchronously. The ArrowAsyncDeviceStreamHandler can then be passed to any asynchronous producer.
  2. ExportAsyncRecordBatchReader takes a record batch generator and a schema, along with an ArrowAsyncDeviceStreamHandler to use for calling the callbacks to push data as it is available from the generator.

Are these changes tested?

Unit tests are added (currently only one test, more tests to be added)

Are there any user-facing changes?

No

  • GitHub Issue: #43631

zeroshade avatar Oct 22 '24 01:10 zeroshade