-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) #48982
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
GH-48949: [C++][Parquet] Add Result versions for parquet::arrow::FileReader::ReadRowGroup(s) #48982
Conversation
|
|
|
@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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
There was a problem hiding this comment.
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.
- Add Result-returning ReadRowGroup/ReadRowGroups - Deprecate Status/out-parameter overloads - Update C++ callers
…ings to Result API
Co-authored-by: Gang Wu <ustcwg@gmail.com>
300da57 to
3025c60
Compare
kou
left a comment
There was a problem hiding this 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)); |
There was a problem hiding this comment.
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.
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
|
I’ve opened a follow‑up issue for RowGroupReader Result APIs: #49025. |
|
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. |
Rationale for this change
FileReader::ReadRowGroup(s)previously returnedStatusand required callers to pass anoutparameter.What changes are included in this PR?
Introduce
Result<std::shared_ptr<Table>>returning APIs to allow clearer error propagation:ReadRowGroup()/ReadRowGroups()methodsAre these changes tested?
Yes.
Are there any user-facing changes?
Yes.
Status versions of FileReader::ReadRowGroup(s) have been deprecated.
arrow::Resultversions forparquet::arrow::FileReader::ReadRowGroupandparquet::arrow::FileReader::ReadRowGroups#48949