kou commented on code in PR #44807:
URL: https://github.com/apache/arrow/pull/44807#discussion_r1852783812
##########
cpp/examples/tutorial_examples/file_access_example.cc:
##########
@@ -180,8 +180,9 @@ arrow::Status RunMain() {
// (Doc section: Parquet OpenFile)
// Note that Parquet's OpenFile() takes the reader by reference, rather than
returning
// a reader.
- PARQUET_THROW_NOT_OK(
- parquet::arrow::OpenFile(infile, arrow::default_memory_pool(), &reader));
+ auto result = parquet::arrow::OpenFile(infile, arrow::default_memory_pool());
+ PARQUET_THROW_NOT_OK(result.status());
+ reader = std::move(result.ValueOrDie());
Review Comment:
We have a convenient macro for this:
```suggestion
PARQUET_ASSIGN_OR_THROW(reader, parquet::arrow::OpenFile(infile,
arrow::default_memory_pool()));
```
For example:
https://github.com/apache/arrow/pull/44785/files#diff-d3ed5886703305596174873a3a9a676cf8fd049707539ce3eed6b0a2551a674dL88-R89
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]