Skip to content

Commit

Permalink
Parquet: fix compiler deprecation warning with libarrow 19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 15, 2025
1 parent 4f6fde6 commit 6f9326a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ static GDALDataset *OGRParquetDriverOpen(GDALOpenInfo *poOpenInfo)
std::unique_ptr<parquet::arrow::FileReader> arrow_reader;
auto poMemoryPool = std::shared_ptr<arrow::MemoryPool>(
arrow::MemoryPool::CreateDefault().release());
#if ARROW_VERSION_MAJOR >= 19
PARQUET_ASSIGN_OR_THROW(
arrow_reader,
parquet::arrow::OpenFile(std::move(infile), poMemoryPool.get()));
#else
auto st = parquet::arrow::OpenFile(std::move(infile),
poMemoryPool.get(), &arrow_reader);
if (!st.ok())
Expand All @@ -455,6 +460,7 @@ static GDALDataset *OGRParquetDriverOpen(GDALOpenInfo *poOpenInfo)
"parquet::arrow::OpenFile() failed");
return nullptr;
}
#endif

auto poDS = std::make_unique<OGRParquetDataset>(poMemoryPool);
auto poLayer = std::make_unique<OGRParquetLayer>(
Expand Down

0 comments on commit 6f9326a

Please sign in to comment.