Skip to content

Conversation

@hiroyuki-sato
Copy link
Collaborator

@hiroyuki-sato hiroyuki-sato commented Nov 28, 2025

Rationale for this change

FileReader::Make previously returned Status and required callers to pass an out parameter.

What changes are included in this PR?

Introduce a Result<std::unique_ptr<FileReader>> returning API to allow clearer error propagation

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions
Copy link

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

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting review Awaiting review awaiting changes Awaiting changes awaiting change review Awaiting change review labels Nov 28, 2025
hiroyuki-sato and others added 8 commits November 29, 2025 21:47
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>
@hiroyuki-sato hiroyuki-sato force-pushed the topic/parquet-result-reader branch from 86eba06 to 7ef530c Compare November 29, 2025 12:47
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Nov 29, 2025
Copy link
Collaborator Author

@hiroyuki-sato hiroyuki-sato left a 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 =
Copy link
Collaborator Author

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?

Copy link
Member

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.

Comment on lines 299 to +302
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());
Copy link
Member

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:

Suggested change
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 =
Copy link
Member

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.

Comment on lines 739 to +742
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());
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
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;

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.

2 participants