Skip to content

Conversation

@fenfeng9
Copy link
Contributor

@fenfeng9 fenfeng9 commented Jan 26, 2026

Rationale for this change

FileReader::ReadRowGroup(s) previously returned Status and required callers to pass an out parameter.

What changes are included in this PR?

Introduce Result<std::shared_ptr<Table>> returning APIs to allow clearer error propagation:

  • Add new Result-returning ReadRowGroup() / ReadRowGroups() methods
  • Deprecate the old Status/out-parameter overloads
  • Update C++ callers and R/Python/GLib bindings to use the new API

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.
Status versions of FileReader::ReadRowGroup(s) have been deprecated.

virtual ::arrow::Status ReadRowGroup(int i, const std::vector<int>& column_indices,
                                     std::shared_ptr<::arrow::Table>* out);
virtual ::arrow::Status ReadRowGroup(int i, std::shared_ptr<::arrow::Table>* out);

virtual ::arrow::Status ReadRowGroups(const std::vector<int>& row_groups,
                                      const std::vector<int>& column_indices,
                                      std::shared_ptr<::arrow::Table>* out);
virtual ::arrow::Status ReadRowGroups(const std::vector<int>& row_groups,
                                      std::shared_ptr<::arrow::Table>* out);

@github-actions
Copy link

⚠️ GitHub issue #48949 has been automatically assigned in GitHub to PR creator.

@fenfeng9
Copy link
Contributor Author

@kou, the PR is ready for review.

// Read everything
ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2));
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a Result version for this ReadTable call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This call is on a RowGroupReader, which still only has the Status + out-parameter API, so I left it unchanged.

Copy link
Member

Choose a reason for hiding this comment

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

Let's work on it as a separated task.

std::shared_ptr<Table> r1, r2, r3, r4;
// Read everything
ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_AND_ASSIGN(auto r1, reader->ReadRowGroup(0));

We have the chance to remove line 2454

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated: r1/r3/r4 use ASSERT_OK_AND_ASSIGN(auto ...), and r2 stays since RowGroupReader::ReadTable is still Status+out.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 27, 2026
@fenfeng9 fenfeng9 force-pushed the refactor/parquet-read-row-group-result branch from 300da57 to 3025c60 Compare January 27, 2026 07:18
@fenfeng9 fenfeng9 requested a review from wgtmac January 27, 2026 08:15
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

// Read everything
ASSERT_OK_NO_THROW(reader->ReadRowGroup(0, &r1));
ASSERT_OK_AND_ASSIGN(r1, reader->ReadRowGroup(0));
ASSERT_OK_NO_THROW(reader->RowGroup(1)->ReadTable(&r2));
Copy link
Member

Choose a reason for hiding this comment

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

Let's work on it as a separated task.

@github-actions github-actions bot added awaiting merge Awaiting merge awaiting review Awaiting review and removed awaiting committer review Awaiting committer review labels Jan 27, 2026
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review awaiting merge Awaiting merge labels Jan 27, 2026
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
@fenfeng9
Copy link
Contributor Author

I’ve opened a follow‑up issue for RowGroupReader Result APIs: #49025.

@kou kou merged commit eb1525e into apache:main Jan 27, 2026
45 of 47 checks passed
@kou kou removed the awaiting committer review Awaiting committer review label Jan 27, 2026
@conbench-apache-arrow
Copy link

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

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.

3 participants