diff --git a/cpp/src/arrow/record_batch.h b/cpp/src/arrow/record_batch.h index c45e500a65c58..95596e9c15594 100644 --- a/cpp/src/arrow/record_batch.h +++ b/cpp/src/arrow/record_batch.h @@ -310,20 +310,22 @@ class ARROW_EXPORT RecordBatchReader { /// \brief Read the next record batch in the stream. Return null for batch /// when reaching end of stream /// - /// example: + /// Example: + /// /// ``` - /// std::shared_ptr batch; /// while (true) { + /// std::shared_ptr batch; /// ARROW_RETURN_NOT_OK(reader->ReadNext(&batch)); - /// if (batch == nullptr) { + /// if (!batch) { /// break; /// } - /// // handling the `batch` + /// // handling the `batch`, the `batch->num_rows()` + /// // might be 0. /// } /// ``` /// - /// \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. + /// \param[out] batch the next loaded batch, null at end of stream. Returning + /// an empty batch doesn't mean the end of stream because it is valid data. /// \return Status virtual Status ReadNext(std::shared_ptr* batch) = 0;