Skip to content

Apache DataFusion SQL Query Engine

chore: remove deprecated Parquet APIs past the API health policy (#25202)

WaterWhisperer5b7cc8703138
diff --git a/datafusion/datasource-parquet/src/file_format.rs b/datafusion/datasource-parquet/src/file_format.rs
index 8bb700b68c..65ea0416b0 100644
--- a/datafusion/datasource-parquet/src/file_format.rs
+++ b/datafusion/datasource-parquet/src/file_format.rs
@@ -67,14 +67,12 @@ use crate::source::{
use async_trait::async_trait;
use bytes::Bytes;
use datafusion_datasource::source::DataSourceExec;
-use datafusion_execution::cache::cache_manager::FileMetadataCache;
use futures::future::BoxFuture;
use futures::{FutureExt, StreamExt, TryStreamExt};
use object_store::path::Path;
use object_store::{ObjectMeta, ObjectStore, ObjectStoreExt};
use parquet::arrow::async_reader::MetadataFetch;
use parquet::errors::ParquetError;
-use parquet::file::metadata::ParquetMetaData;
#[derive(Default)]
/// Factory struct used to create [ParquetFormat]
@@ -639,68 +637,6 @@ impl MetadataFetch for ObjectStoreFetch<'_> {
}
}
-/// Fetches parquet metadata from ObjectStore for given object
-///
-/// This component is a subject to **change** in near future and is exposed for low level integrations
-/// through [`ParquetFileReaderFactory`].
-///
-/// [`ParquetFileReaderFactory`]: crate::ParquetFileReaderFactory
-#[deprecated(
- since = "50.0.0",
- note = "Use `DFParquetMetadata::fetch_metadata` instead"
-)]
-pub async fn fetch_parquet_metadata(
- store: &dyn ObjectStore,
- object_meta: &ObjectMeta,
- size_hint: Option<usize>,
- decryption_properties: Option<&FileDecryptionProperties>,
- file_metadata_cache: Option<Arc<FileMetadataCache>>,
-) -> Result<Arc<ParquetMetaData>> {
- let decryption_properties = decryption_properties.cloned().map(Arc::new);
- DFParquetMetadata::new(store, object_meta)
- .with_metadata_size_hint(size_hint)
- .with_decryption_properties(decryption_properties)
- .with_file_metadata_cache(file_metadata_cache)
- .fetch_metadata()
- .await
-}
-
-/// Read and parse the statistics of the Parquet file at location `path`
-///
-/// See [`statistics_from_parquet_meta_calc`] for more details
-#[deprecated(
- since = "50.0.0",
- note = "Use `DFParquetMetadata::fetch_statistics` instead"
-)]
-pub async fn fetch_statistics(
- store: &dyn ObjectStore,
- table_schema: SchemaRef,
- file: &ObjectMeta,
- metadata_size_hint: Option<usize>,
- decryption_properties: Option<&FileDecryptionProperties>,
- file_metadata_cache: Option<Arc<FileMetadataCache>>,
-) -> Result<Statistics> {
- let decryption_properties = decryption_properties.cloned().map(Arc::new);
- DFParquetMetadata::new(store, file)
- .with_metadata_size_hint(metadata_size_hint)
- .with_decryption_properties(decryption_properties)
- .with_file_metadata_cache(file_metadata_cache)
- .fetch_statistics(&table_schema)
- .await
-}
-
-#[deprecated(
- since = "50.0.0",
- note = "Use `DFParquetMetadata::statistics_from_parquet_metadata` instead"
-)]
-#[expect(clippy::needless_pass_by_value)]
-pub fn statistics_from_parquet_meta_calc(
- metadata: &ParquetMetaData,
- table_schema: SchemaRef,
-) -> Result<Statistics> {
- DFParquetMetadata::statistics_from_parquet_metadata(metadata, &table_schema)
-}
-
#[cfg(feature = "proto")]
use datafusion_proto_models::protobuf::{self, parquet_column_options, parquet_options};
diff --git a/datafusion/datasource-parquet/src/source.rs b/datafusion/datasource-parquet/src/source.rs
index e1434824e4..3df0e0e7e1 100644
--- a/datafusion/datasource-parquet/src/source.rs
+++ b/datafusion/datasource-parquet/src/source.rs
@@ -400,12 +400,6 @@ impl ParquetSource {
&self.table_parquet_options
}
- /// Optional predicate.
- #[deprecated(since = "50.2.0", note = "use `filter` instead")]
- pub fn predicate(&self) -> Option<&Arc<dyn PhysicalExpr>> {
- self.predicate.as_ref()
- }
-
/// return the optional file reader factory
pub fn parquet_file_reader_factory(
&self,
@@ -1364,17 +1358,6 @@ mod tests {
use arrow::datatypes::Schema;
use datafusion_physical_expr::expressions::lit;
- #[test]
- #[expect(deprecated)]
- fn test_parquet_source_predicate_same_as_filter() {
- let predicate = lit(true);
-
- let parquet_source =
- ParquetSource::new(Arc::new(Schema::empty())).with_predicate(predicate);
- // same value. but filter() call Arc::clone internally
- assert_eq!(parquet_source.predicate(), parquet_source.filter().as_ref());
- }
-
#[test]
fn test_reverse_scan_default_value() {
use arrow::datatypes::Schema;