Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: [C++][Docs] Enhance document for RecordBatchReader::ReadNext #42239

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Jun 21, 2024

Rationale for this change

Enhance the document for RecordBatchReader::ReadNext

What changes are included in this PR?

Add an example for RecordBatchReader::ReadNext.

Are these changes tested?

No

Are there any user-facing changes?

No

@mapleFU
Copy link
Member Author

mapleFU commented Jun 21, 2024

@kou @pitrou Would you mind take a look? This is just a doc change

cpp/src/arrow/record_batch.h Outdated Show resolved Hide resolved
/// std::shared_ptr<RecordBatch> batch;
/// while (true) {
/// ARROW_RETURN_NOT_OK(reader->ReadNext(&batch));
/// if (batch == nullptr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a block to suggest skipping empty batch?

if (batch->num_rows() == 0) {
  continue;
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I found some place handled this( like DatasetWriter ) but some not...

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jun 21, 2024
@kou kou changed the title MINOR: enhance document for RecordBatchReader::ReadNext MINOR: [C++] Enhance document for RecordBatchReader::ReadNext Jun 21, 2024
@kou kou changed the title MINOR: [C++] Enhance document for RecordBatchReader::ReadNext MINOR: [C++][Docs] Enhance document for RecordBatchReader::ReadNext Jun 21, 2024
cpp/src/arrow/record_batch.h Outdated Show resolved Hide resolved
cpp/src/arrow/record_batch.h Outdated Show resolved Hide resolved
@kou
Copy link
Member

kou commented Jun 21, 2024

@github-actions crossbow submit preview-docs

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Jun 21, 2024
Copy link

Revision: 78755f9

Submitted crossbow builds: ursacomputing/crossbow @ actions-73318a0fd1

Task Status
preview-docs GitHub Actions

@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jun 24, 2024
@mapleFU
Copy link
Member Author

mapleFU commented Jun 24, 2024

Hmmm at least this looks better than before

/// if (!batch) {
/// break;
/// }
/// // handling the `batch`, the `batch->size()`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RecordBatch doesn't actually have a size method. Perhaps you mean batch->num_rows()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah

@kou
Copy link
Member

kou commented Jun 24, 2024

@github-actions crossbow submit preview-docs

Copy link

Revision: 65c3d53

Submitted crossbow builds: ursacomputing/crossbow @ actions-2c8f4ac0c5

Task Status
preview-docs GitHub Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Jun 24, 2024
@mapleFU mapleFU requested a review from pitrou June 25, 2024 14:52
@mapleFU mapleFU merged commit f5b01e4 into apache:main Jun 25, 2024
35 of 41 checks passed
@mapleFU mapleFU removed the awaiting merge Awaiting merge label Jun 25, 2024
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit f5b01e4.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

@mapleFU mapleFU deleted the minor/doc-for-empty-batch branch June 27, 2024 03:09
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Jul 9, 2024
…pache#42239)

### Rationale for this change

Enhance the document for `RecordBatchReader::ReadNext`

### What changes are included in this PR?

Add an example for `RecordBatchReader::ReadNext`.

### Are these changes tested?

No

### Are there any user-facing changes?

No

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: mwish <maplewish117@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants