Skip to content

Commit

Permalink
Add context for what additional_metadata might be used for.
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroshade committed Nov 6, 2024
1 parent 5aa29a8 commit ca9dfbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cpp/src/arrow/c/abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ struct ArrowAsyncProducer {

// Any additional metadata tied to a specific stream of data. This must either be NULL
// or a valid pointer to metadata which is encoded in the same way schema metadata
// would be. Non-null metadata must be valid for the lifetime of this object.
// would be. Non-null metadata must be valid for the lifetime of this object. As an
// example a producer could use this to provide the total number of rows and/or batches
// in the stream if known.
const char* additional_metadata;

// producer-specific opaque data.
Expand Down
6 changes: 5 additions & 1 deletion docs/source/format/CDeviceDataInterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,12 @@ The structure has the following fields:
*Mandatory.* The producer object that the consumer will use to request additional data or cancel.

This object *MUST* be populated before calling the :c:member:`ArrowAsyncDeviceStreamHandler.on_schema`
This object *MUST* be populated by the producer before calling the :c:member:`ArrowAsyncDeviceStreamHandler.on_schema`
callback. The producer maintains ownership of this object and must clean it up *after* calling
the release callback on the ``ArrowAsyncDeviceStreamHandler``.

The consumer *CANNOT* assume that this is valid until the ``on_schema`` callback is called.

.. c:member:: void* ArrowAsyncDeviceStreamHandler.private_data
*Optional.* An opaque pointer to consumer-provided private data.
Expand Down Expand Up @@ -913,6 +915,8 @@ This producer-provided and managed object has the following fields:
*Optional.* An additional metadata string to provide any extra context to the consumer. This *MUST*
either be ``NULL`` or a valid string that is encoded in the same way as :c:member:`ArrowSchema.metadata`.
As an example, a producer could utilize this metadata to provide the total number of rows and/or batches
in the stream if known.

If not ``NULL`` it *MUST* be valid for at least the lifetime of this object.

Expand Down

0 comments on commit ca9dfbd

Please sign in to comment.