kiszk commented on a change in pull request #7507: URL: https://github.com/apache/arrow/pull/7507#discussion_r577078249
########## File path: cpp/src/arrow/ipc/reader.cc ########## @@ -108,6 +109,20 @@ Status InvalidMessageType(MessageType expected, MessageType actual) { // ---------------------------------------------------------------------- // Record batch read path +/// \brief Structure to keep common arguments to be passed +struct IpcReadContext { + IpcReadContext(DictionaryMemo* memo, const IpcReadOptions& option, bool swap) + : dictionary_memo(memo), options(option), swap_endian(swap) {} + + DictionaryMemo* dictionary_memo; + + const IpcReadOptions& options; + + /// \brief LoadRecordBatch() or LoadRecordBatchSubset() swaps endianness of elements + /// if this flag is true + const bool swap_endian; +}; Review comment: Most use cases of `IpcReadContext`, `ReadRecordBatchInternal()` do not receieve `MetadataVersion` and `Compression::type`. If we pass default values for these two variables at the constructor, it would be useful to add them. So, we do not need to pass values to `IpcReadContent ipc(...)` before calling ReadRecordBatchInternal(). Do you want to add them while we use default values at the constructor? I am neutral on this. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org