From b87c82975dad1a330d1784f75060b68865d7681e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 5 Dec 2023 17:35:31 +0100 Subject: [PATCH] add back compat shim for EvaluateStatisticsAsExpression --- cpp/src/arrow/dataset/file_parquet.cc | 6 ++++++ cpp/src/arrow/dataset/file_parquet.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/cpp/src/arrow/dataset/file_parquet.cc b/cpp/src/arrow/dataset/file_parquet.cc index e88fe0e3e3444..a55588431588e 100644 --- a/cpp/src/arrow/dataset/file_parquet.cc +++ b/cpp/src/arrow/dataset/file_parquet.cc @@ -418,6 +418,12 @@ std::optional ParquetFileFragment::EvaluateStatisticsAsExpr return std::nullopt; } +std::optional ParquetFileFragment::EvaluateStatisticsAsExpression( + const Field& field, const parquet::Statistics& statistics) { + const auto field_name = field.name(); + EvaluateStatisticsAsExpression(field, FieldRef(field_name), statistics); +} + ParquetFileFormat::ParquetFileFormat() : FileFormat(std::make_shared()) {} diff --git a/cpp/src/arrow/dataset/file_parquet.h b/cpp/src/arrow/dataset/file_parquet.h index 75cefb4ec99fb..1e81a34fb3cf0 100644 --- a/cpp/src/arrow/dataset/file_parquet.h +++ b/cpp/src/arrow/dataset/file_parquet.h @@ -174,6 +174,9 @@ class ARROW_DS_EXPORT ParquetFileFragment : public FileFragment { Result> Subset(compute::Expression predicate); Result> Subset(std::vector row_group_ids); + static std::optional EvaluateStatisticsAsExpression( + const Field& field, const parquet::Statistics& statistics); + static std::optional EvaluateStatisticsAsExpression( const Field& field, const FieldRef& field_ref, const parquet::Statistics& statistics);