Repository: apache/arrow
File: cpp/src/parquet/arrow/reader.cc (C++)

Code before:
}

Status FileReader::GetRecordBatchReader(const std::vector<int>& row_group_indices,
                                        const std::vector<int>& column_indices,
                                        std::shared_ptr<RecordBatchReader>* out) {
  ARROW_ASSIGN_OR_RAISE(auto tmp,
                        GetRecordBatchReader(row_group_indices, column_indices));
  out->reset(tmp.release());
  return Status::OK();
}

Status FileReader::Make(::arrow::MemoryPool* pool,
                        std::unique_ptr<ParquetFileReader> reader,
                        const ArrowReaderProperties& properties,
                        std::unique_ptr<FileReader>* out) {
  ARROW_ASSIGN_OR_RAISE(auto result, Make(pool, std::move(reader), properties));
  *out = std::move(result);
  return Status::OK();
}

Status FileReader::Make(::arrow::MemoryPool* pool,
                        std::unique_ptr<ParquetFileReader> reader,
                        std::unique_ptr<FileReader>* out) {
  ARROW_ASSIGN_OR_RAISE(auto result,
                        Make(pool, std::move(reader), default_arrow_reader_properties()));
  *out = std::move(result);
  return Status::OK();
}

Result<std::unique_ptr<FileReader>> FileReader::Make(
    ::arrow::MemoryPool* pool, std::unique_ptr<ParquetFileReader> parquet_reader,
    const ArrowReaderProperties& properties) {
  std::unique_ptr<FileReader> reader =
      std::make_unique<FileReaderImpl>(pool, std::move(parquet_reader), properties);
  RETURN_NOT_OK(static_cast<FileReaderImpl*>(reader.get())->Init());
  return reader;
}

Result<std::unique_ptr<FileReader>> FileReader::Make(
    ::arrow::MemoryPool* pool, std::unique_ptr<ParquetFileReader> parquet_reader) {
  std::unique_ptr<FileReader> reader = std::make_unique<FileReaderImpl>(
      pool, std::move(parquet_reader), default_arrow_reader_properties());
  RETURN_NOT_OK(static_cast<FileReaderImpl*>(reader.get())->Init());
  return reader;
}

FileReaderBuilder::FileReaderBuilder()
    : pool_(::arrow::default_memory_pool()),
      properties_(default_arrow_reader_properties()) {}

Status FileReaderBuilder::Open(std::shared_ptr<::arrow::io::RandomAccessFile> file,

Review comment (suggestion):
```suggestion
  ARROW_ASSIGN_OR_RAISE(*out,
                        Make(pool, std::move(reader), default_arrow_reader_properties()));
```

Code after:
}

Status FileReader::GetRecordBatchReader(const std::vector<int>& row_group_indices,
                                        const std::vector<int>& column_indices,
                                        std::shared_ptr<RecordBatchReader>* out) {
  ARROW_ASSIGN_OR_RAISE(auto tmp,
                        GetRecordBatchReader(row_group_indices, column_indices));
  out->reset(tmp.release());
  return Status::OK();
}

Status FileReader::Make(::arrow::MemoryPool* pool,
                        std::unique_ptr<ParquetFileReader> reader,
                        const ArrowReaderProperties& properties,
                        std::unique_ptr<FileReader>* out) {
  ARROW_ASSIGN_OR_RAISE(*out, Make(pool, std::move(reader), properties));
  return Status::OK();
}

Status FileReader::Make(::arrow::MemoryPool* pool,
                        std::unique_ptr<ParquetFileReader> reader,
                        std::unique_ptr<FileReader>* out) {
  ARROW_ASSIGN_OR_RAISE(*out,
                        Make(pool, std::move(reader), default_arrow_reader_properties()));
  return Status::OK();
}

Result<std::unique_ptr<FileReader>> FileReader::Make(
    ::arrow::MemoryPool* pool, std::unique_ptr<ParquetFileReader> parquet_reader,
    const ArrowReaderProperties& properties) {
  std::unique_ptr<FileReader> reader =
      std::make_unique<FileReaderImpl>(pool, std::move(parquet_reader), properties);
  RETURN_NOT_OK(static_cast<FileReaderImpl*>(reader.get())->Init());
  return reader;
}

Result<std::unique_ptr<FileReader>> FileReader::Make(
    ::arrow::MemoryPool* pool, std::unique_ptr<ParquetFileReader> parquet_reader) {
  return Make(pool, std::move(parquet_reader), default_arrow_reader_properties());
}

FileReaderBuilder::FileReaderBuilder()
    : pool_(::arrow::default_memory_pool()),
      properties_(default_arrow_reader_properties()) {}

Status FileReaderBuilder::Open(std::shared_ptr<::arrow::io::RandomAccessFile> file,
                               const ReaderProperties& properties,
                               std::shared_ptr<FileMetaData> metadata) {
  PARQUET_CATCH_NOT_OK(raw_reader_ = ParquetReader::Open(std::move(file), properties,
                                                         std::move(metadata)));
  return Status::OK();