From 6f9326a8ba19928f1f9107ae9b65b55c0a8627bb Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 16 Jan 2025 00:19:42 +0100 Subject: [PATCH] Parquet: fix compiler deprecation warning with libarrow 19.0 --- ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp b/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp index 580951000202..2cf4524baab2 100644 --- a/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp +++ b/ogr/ogrsf_frmts/parquet/ogrparquetdriver.cpp @@ -447,6 +447,11 @@ static GDALDataset *OGRParquetDriverOpen(GDALOpenInfo *poOpenInfo) std::unique_ptr arrow_reader; auto poMemoryPool = std::shared_ptr( 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()) @@ -455,6 +460,7 @@ static GDALDataset *OGRParquetDriverOpen(GDALOpenInfo *poOpenInfo) "parquet::arrow::OpenFile() failed"); return nullptr; } +#endif auto poDS = std::make_unique(poMemoryPool); auto poLayer = std::make_unique(