From d90f24d711454e9eaa364b43c9c8175cfedf9ab1 Mon Sep 17 00:00:00 2001 From: Eero Lihavainen Date: Mon, 2 Oct 2023 18:43:44 +0300 Subject: [PATCH] formatting --- cpp/src/arrow/dataset/file_parquet.cc | 50 ++++++++++++++------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/cpp/src/arrow/dataset/file_parquet.cc b/cpp/src/arrow/dataset/file_parquet.cc index 5d62bc31304bb..3cad1ddd8321f 100644 --- a/cpp/src/arrow/dataset/file_parquet.cc +++ b/cpp/src/arrow/dataset/file_parquet.cc @@ -482,31 +482,33 @@ Future> ParquetFileFormat::GetReader auto self = checked_pointer_cast(shared_from_this()); - return source.OpenAsync().Then([=](const std::shared_ptr& input) mutable { - return parquet::ParquetFileReader::OpenAsync(input, std::move(properties), metadata) - .Then( - [=](const std::unique_ptr& reader) mutable - -> Result> { - auto arrow_properties = MakeArrowReaderProperties( - *self, *reader->metadata(), *options, *parquet_scan_options); - - std::unique_ptr arrow_reader; - RETURN_NOT_OK(parquet::arrow::FileReader::Make( - options->pool, - // TODO(ARROW-12259): workaround since we have Future<(move-only type)> - // It *wouldn't* be safe to const_cast reader except that here we know - // there are no other waiters on the reader. - std::move( - const_cast&>(reader)), - std::move(arrow_properties), &arrow_reader)); - - return std::move(arrow_reader); - }, - [path = source.path()](const Status& status) + return source.OpenAsync().Then( + [=](const std::shared_ptr& input) mutable { + return parquet::ParquetFileReader::OpenAsync(input, std::move(properties), + metadata) + .Then( + [=](const std::unique_ptr& reader) mutable -> Result> { - return WrapSourceError(status, path); - }); - }); + auto arrow_properties = MakeArrowReaderProperties( + *self, *reader->metadata(), *options, *parquet_scan_options); + + std::unique_ptr arrow_reader; + RETURN_NOT_OK(parquet::arrow::FileReader::Make( + options->pool, + // TODO(ARROW-12259): workaround since we have Future<(move-only + // type)> It *wouldn't* be safe to const_cast reader except that + // here we know there are no other waiters on the reader. + std::move(const_cast&>( + reader)), + std::move(arrow_properties), &arrow_reader)); + + return std::move(arrow_reader); + }, + [path = source.path()](const Status& status) + -> Result> { + return WrapSourceError(status, path); + }); + }); } struct SlicingGenerator {