Skip to content

Commit 75ffc2d

Browse files
committed
fix(parquet): select FileReader::Make overload by Arrow version
The earlier Arrow-22 fix switched unconditionally to the Status/out-param FileReader::Make. That form is deprecated in Arrow 23.0.0, and the fork's CI builds against a newer vendored Arrow with -Werror=deprecated-declarations, so the build broke. Guard the call on ARROW_VERSION_MAJOR: use the arrow::Result-returning overload on Arrow >= 23 (matches upstream) and the out-parameter form on Arrow 22 (needed by Oxla). Verified compiling against the vendored Arrow 24 with the CI -Werror flags.
1 parent 8e62913 commit 75ffc2d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/iceberg/parquet/parquet_reader.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <arrow/record_batch.h>
2727
#include <arrow/result.h>
2828
#include <arrow/type.h>
29+
#include <arrow/util/config.h>
2930
#include <arrow/util/key_value_metadata.h>
3031
#include <parquet/arrow/reader.h>
3132
#include <parquet/arrow/schema.h>
@@ -123,8 +124,16 @@ class ParquetReader::Impl {
123124
ICEBERG_ASSIGN_OR_RAISE(input_stream_, OpenInputStream(options));
124125
auto file_reader =
125126
::parquet::ParquetFileReader::Open(input_stream_, reader_properties);
127+
// Arrow >= 23 provides (and prefers) the arrow::Result-returning overload and
128+
// deprecates the out-parameter form; Arrow 22 only has the out-parameter form.
129+
#if ARROW_VERSION_MAJOR >= 23
130+
ICEBERG_ARROW_ASSIGN_OR_RETURN(
131+
reader_, ::parquet::arrow::FileReader::Make(pool_, std::move(file_reader),
132+
arrow_reader_properties));
133+
#else
126134
ICEBERG_ARROW_RETURN_NOT_OK(::parquet::arrow::FileReader::Make(
127135
pool_, std::move(file_reader), arrow_reader_properties, &reader_));
136+
#endif
128137

129138
// Project read schema onto the Parquet file schema
130139
ICEBERG_ASSIGN_OR_RAISE(projection_, BuildProjection(reader_.get(), *read_schema_));

0 commit comments

Comments
 (0)