diff --git a/cpp/examples/tutorial_examples/file_access_example.cc b/cpp/examples/tutorial_examples/file_access_example.cc index fdc312ff421c1..df57174b31166 100644 --- a/cpp/examples/tutorial_examples/file_access_example.cc +++ b/cpp/examples/tutorial_examples/file_access_example.cc @@ -180,8 +180,8 @@ 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)); + PARQUET_ASSIGN_OR_THROW(reader, + parquet::arrow::OpenFile(infile, arrow::default_memory_pool())); // (Doc section: Parquet OpenFile) // (Doc section: Parquet Read)