From 78755f942f0598535fcffb55c3c60a07f0bdee15 Mon Sep 17 00:00:00 2001 From: mwish Date: Fri, 21 Jun 2024 11:01:31 +0800 Subject: [PATCH] MINOR: enhance document for RecordBatchReader::ReadNext --- cpp/src/arrow/record_batch.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/record_batch.h b/cpp/src/arrow/record_batch.h index b03cbf2251f47..c45e500a65c58 100644 --- a/cpp/src/arrow/record_batch.h +++ b/cpp/src/arrow/record_batch.h @@ -310,7 +310,20 @@ class ARROW_EXPORT RecordBatchReader { /// \brief Read the next record batch in the stream. Return null for batch /// when reaching end of stream /// - /// \param[out] batch the next loaded batch, null at end of stream + /// example: + /// ``` + /// std::shared_ptr batch; + /// while (true) { + /// ARROW_RETURN_NOT_OK(reader->ReadNext(&batch)); + /// if (batch == nullptr) { + /// break; + /// } + /// // handling the `batch` + /// } + /// ``` + /// + /// \param[out] batch the next loaded batch, null at end of stream. Return + /// a empty batch doesn't means the end of stream, it could be a empty batch. /// \return Status virtual Status ReadNext(std::shared_ptr* batch) = 0;