pitrou commented on PR #12812:
URL: https://github.com/apache/arrow/pull/12812#issuecomment-1097832538

   So, basically, per-message metadata is an Arrow *IPC* feature that's 
independent from record batches or schemas. That's why you don't see it 
mentioned in the [schema metadata 
documentation](https://arrow.apache.org/docs/python/data.html#custom-schema-and-field-metadata).
   
   > If message metadata is different from schema metadata, the question here 
may be slightly more complex since in this case, each record batch may provide 
1) this record batch's schema specific metadata, this seems not 
serialized/deserialized 2) this record batch's message specific metadata, we 
don't seem to provide API for reading/writing this
   
   Indeed the message metadata wouldn't be attached to the record batch or 
schema, but passed separately.
   
   One possible API on the write side:
   ```c++
   class ARROW_EXPORT RecordBatchWriter {
    public:
     // (default implementation could call `WriteRecordBatch(batch)` while 
ignoring metadata?)
     virtual Status WriteRecordBatch(const RecordBatch& batch, const 
KeyValueMetadata& custom_metadata);
   ```
   
   and on the read side:
   ```c++
   class ARROW_EXPORT RecordBatchReader {
    public:
     // (default implementation could call `ReadNext(batch)` and reset 
`*custom_metadata` to null)
     virtual Status ReadNext(std::shared_ptr<RecordBatch>* batch, 
std::shared_ptr<KeyValueMetadata>* custom_metadata);
   ```
   


-- 
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]

Reply via email to