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?

Yes.

Status version FileReader::Make has been deprecated.

  static ::arrow::Status Make(::arrow::MemoryPool* pool,
                              std::unique_ptr<ParquetFileReader> reader,
                              const ArrowReaderProperties& properties,
                              std::unique_ptr<FileReader>* out);

  static ::arrow::Status Make(::arrow::MemoryPool* pool,
                              std::unique_ptr<ParquetFileReader> reader,
                              std::unique_ptr<FileReader>* out);

@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 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.

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Dec 1, 2025
@github-actions github-actions bot added awaiting changes Awaiting changes Component: Gandiva awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Dec 2, 2025
@hiroyuki-sato hiroyuki-sato force-pushed the topic/parquet-result-reader branch from c3bb1d2 to 39cc9ea Compare December 8, 2025 00:44
@hiroyuki-sato
Copy link
Collaborator Author

@kou Could you check this PR when you get a chance?

Comment on lines 4262 to +4263
std::unique_ptr<FileReader> arrow_reader;
ASSERT_OK(FileReader::Make(default_memory_pool(), std::move(reader), &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
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;
ASSERT_OK(FileReader::Make(default_memory_pool(), std::move(reader), &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
ASSERT_OK_AND_ASSIGN(auto arrow_reader,

Comment on lines 4367 to 4369
std::unique_ptr<FileReader> reader;
ASSERT_OK_NO_THROW(
FileReader::Make(default_memory_pool(), std::move(file_reader), &reader));
ASSERT_OK_AND_ASSIGN(reader,
FileReader::Make(default_memory_pool(), std::move(file_reader)));
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> reader;
ASSERT_OK_NO_THROW(
FileReader::Make(default_memory_pool(), std::move(file_reader), &reader));
ASSERT_OK_AND_ASSIGN(reader,
FileReader::Make(default_memory_pool(), std::move(file_reader)));
ASSERT_OK_AND_ASSIGN(auto reader,
FileReader::Make(default_memory_pool(), std::move(file_reader)));

Comment on lines 4432 to 4433
std::unique_ptr<FileReader> arrow_reader;
ASSERT_OK_NO_THROW(
FileReader::Make(pool, ParquetFileReader::OpenFile(path, false), &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
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;
ASSERT_OK_NO_THROW(
FileReader::Make(pool, ParquetFileReader::OpenFile(path, false), &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
ASSERT_OK_AND_ASSIGN(auto arrow_reader,

Comment on lines 4499 to 4501
std::unique_ptr<FileReader> reader;
ASSERT_OK_NO_THROW(
FileReader::Make(pool, ParquetFileReader::OpenFile(path, false), &reader));
ASSERT_OK_AND_ASSIGN(
reader, FileReader::Make(pool, ParquetFileReader::OpenFile(path, false)));
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> reader;
ASSERT_OK_NO_THROW(
FileReader::Make(pool, ParquetFileReader::OpenFile(path, false), &reader));
ASSERT_OK_AND_ASSIGN(
reader, FileReader::Make(pool, ParquetFileReader::OpenFile(path, false)));
ASSERT_OK_AND_ASSIGN(
auto reader, FileReader::Make(pool, ParquetFileReader::OpenFile(path, false)));

Comment on lines 4544 to 4546
std::unique_ptr<FileReader> file_reader;
ASSERT_OK(
FileReader::Make(::arrow::default_memory_pool(), std::move(reader), &file_reader));
ASSERT_OK_AND_ASSIGN(
file_reader, FileReader::Make(::arrow::default_memory_pool(), std::move(reader)));
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> file_reader;
ASSERT_OK(
FileReader::Make(::arrow::default_memory_pool(), std::move(reader), &file_reader));
ASSERT_OK_AND_ASSIGN(
file_reader, FileReader::Make(::arrow::default_memory_pool(), std::move(reader)));
ASSERT_OK_AND_ASSIGN(
auto file_reader, FileReader::Make(::arrow::default_memory_pool(), std::move(reader)));

Comment on lines 5206 to +5208
std::unique_ptr<FileReader> parquet_reader;
ASSERT_OK(FileReader::Make(pool, ParquetFileReader::OpenFile(file, false), properties,
&parquet_reader));
ASSERT_OK_AND_ASSIGN(
parquet_reader,
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> parquet_reader;
ASSERT_OK(FileReader::Make(pool, ParquetFileReader::OpenFile(file, false), properties,
&parquet_reader));
ASSERT_OK_AND_ASSIGN(
parquet_reader,
ASSERT_OK_AND_ASSIGN(
auto parquet_reader,

Comment on lines 5735 to 5736
std::unique_ptr<FileReader> arrow_reader;
ASSERT_OK(FileReader::Make(pool, std::move(reader), read_properties, &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
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;
ASSERT_OK(FileReader::Make(pool, std::move(reader), read_properties, &arrow_reader));
ASSERT_OK_AND_ASSIGN(arrow_reader,
ASSERT_OK_AND_ASSIGN(auto arrow_reader,

auto arrow_reader_result =
FileReader::Make(::arrow::default_memory_pool(), std::move(reader));
EXIT_NOT_OK(arrow_reader_result.status());
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_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.

Suggested change
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_reader_result);
auto arrow_reader = std::move(*arrow_reader_result);

auto arrow_reader_result =
FileReader::Make(::arrow::default_memory_pool(), std::move(reader));
EXIT_NOT_OK(arrow_reader_result.status());
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_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.

Suggested change
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_reader_result);
auto arrow_reader = std::move(*arrow_reader_result);

auto arrow_reader_result =
FileReader::Make(::arrow::default_memory_pool(), std::move(reader));
EXIT_NOT_OK(arrow_reader_result.status());
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_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.

Suggested change
std::shared_ptr<FileReader> arrow_reader = std::move(*arrow_reader_result);
auto arrow_reader = std::move(*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