pitrou commented on code in PR #12812:
URL: https://github.com/apache/arrow/pull/12812#discussion_r852245531
##########
cpp/src/arrow/ipc/reader.h:
##########
@@ -190,6 +190,15 @@ class ARROW_EXPORT RecordBatchFileReader
/// \return the read batch
virtual Result<std::shared_ptr<RecordBatch>> ReadRecordBatch(int i) = 0;
+ /// \brief Read a particular record batch along with its custom metadatda
from the file.
+ /// Does not copy memory if the input source supports zero-copy.
+ ///
+ /// \param[in] i the index of the record batch to return
+ /// \return a pair of the read batch and its custom metadata
+ virtual Result<
+ std::pair<std::shared_ptr<RecordBatch>,
std::shared_ptr<KeyValueMetadata>>>
+ ReadRecordBatchWithCustomMetadata(int i) = 0;
Review Comment:
I think user code would be more readable with:
```c++
struct RecordBatchWithMetadata {
std::shared_ptr<RecordBatch> batch;
std::shared_ptr<KeyValueMetadata> custom_metadata;
};
virtual Result<RecordBatchWithMetadata> ReadRecordBatchWithMetadata(int i) =
0;
```
--
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]