-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-44810: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::Make() #48285
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
base: main
Are you sure you want to change the base?
GH-44810: [C++][Parquet] Add arrow::Result version of parquet::arrow::FileReader::Make() #48285
Conversation
|
|
…arrow::FileReader::Make()
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
86eba06 to
7ef530c
Compare
hiroyuki-sato
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.
@kou CI passed Please take a look when you get a chacne.
| std::unique_ptr<FileReader> arrow_reader; | ||
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | ||
| &arrow_reader)); | ||
| auto reader_result = |
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.
Can we use ASSERT_OK_AND_ASSIGN here?
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.
No. ASSERT_OK_AND_ASSIGN() is for Google Test. Benchmarks uses Google Benchmark not Google Test.
| std::unique_ptr<FileReader> arrow_reader; | ||
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | ||
| &arrow_reader)); | ||
| auto reader_result = | ||
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | ||
| EXIT_NOT_OK(reader_result.status()); |
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.
We need to assign to arrow_reader:
| std::unique_ptr<FileReader> arrow_reader; | |
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | |
| &arrow_reader)); | |
| auto reader_result = | |
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | |
| EXIT_NOT_OK(reader_result.status()); | |
| auto arrow_reader_result = | |
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | |
| EXIT_NOT_OK(arrow_reader_result.status()); | |
| auto arrow_reader = *arrow_reader_result; |
| std::unique_ptr<FileReader> arrow_reader; | ||
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | ||
| &arrow_reader)); | ||
| auto reader_result = |
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.
No. ASSERT_OK_AND_ASSIGN() is for Google Test. Benchmarks uses Google Benchmark not Google Test.
| std::unique_ptr<FileReader> arrow_reader; | ||
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | ||
| &arrow_reader)); | ||
| auto reader_result = | ||
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | ||
| EXIT_NOT_OK(reader_result.status()); |
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.
| std::unique_ptr<FileReader> arrow_reader; | |
| EXIT_NOT_OK(FileReader::Make(::arrow::default_memory_pool(), std::move(reader), | |
| &arrow_reader)); | |
| auto reader_result = | |
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | |
| EXIT_NOT_OK(reader_result.status()); | |
| auto arrow_reader_result = | |
| FileReader::Make(::arrow::default_memory_pool(), std::move(reader)); | |
| EXIT_NOT_OK(reader_result.status()); | |
| auto arrow_reader = *arrow_reader_result; |
Rationale for this change
FileReader::Makepreviously returnedStatusand required callers to pass anoutparameter.What changes are included in this PR?
Introduce a
Result<std::unique_ptr<FileReader>>returning API to allow clearer error propagationAre these changes tested?
Yes.
Are there any user-facing changes?
No.
arrow::Resultversion ofparquet::arrow::FileReader::Make()#44810