You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/06/23 20:17:33 UTC

(datafusion) 01/01: chore(parquet): remove deprecated schema-coercion helpers (Closes #23080 - partial) (#23132)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23132-63ad99181a1b1456a2670e3bd6ea315f53a13d84
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit 8839a59de9d1f1324c9ac9b8d72dac88f3b7ea3b
Author: Giorgio Maria Federico Birnthaler <12...@users.noreply.github.com>
AuthorDate: Tue Jun 23 22:17:08 2026 +0200

    chore(parquet): remove deprecated schema-coercion helpers (Closes #23080 - partial) (#23132)
    
    Removes coerce_file_schema_to_view_type and
    coerce_file_schema_to_string_type (both deprecated since 47.0.0 with
    replacement apply_file_schema_type_coercions). Zero callers in the
    workspace; only the function definitions and re-export entries in mod.rs
    / file_format.rs remain. Drops the now-unused #[expect(deprecated)]
    attribute on the re-export lines. Pure 118-line deletion across 3 files.
    Part of #23080 (partial - third in the housekeeping series after #23129
    and #23131). AI assistance: used an AI coding assistant to identify and
    remove unused symbols; verified via repo-wide grep that the deprecated
    functions have no callers.
    
    ---------
    
    Co-authored-by: Andrew Lamb <an...@nerdnetworks.org>
---
 datafusion/datasource-parquet/src/file_format.rs   |   7 +-
 datafusion/datasource-parquet/src/mod.rs           |   6 +-
 .../datasource-parquet/src/schema_coercion.rs      | 112 ---------------------
 3 files changed, 7 insertions(+), 118 deletions(-)

diff --git a/datafusion/datasource-parquet/src/file_format.rs b/datafusion/datasource-parquet/src/file_format.rs
index 734ec6b536..e89cff2aaf 100644
--- a/datafusion/datasource-parquet/src/file_format.rs
+++ b/datafusion/datasource-parquet/src/file_format.rs
@@ -24,11 +24,12 @@ use std::sync::Arc;
 
 // Re-export so the historical `file_format::*` paths still resolve.
 #[expect(deprecated)]
+pub use crate::schema_coercion::coerce_int96_to_resolution;
 pub use crate::schema_coercion::{
-    Int96Coercer, apply_file_schema_type_coercions, coerce_file_schema_to_string_type,
-    coerce_file_schema_to_view_type, coerce_int96_to_resolution,
-    transform_binary_to_string, transform_schema_to_view,
+    Int96Coercer, apply_file_schema_type_coercions, transform_binary_to_string,
+    transform_schema_to_view,
 };
+
 pub use crate::sink::ParquetSink;
 
 use arrow::datatypes::{Fields, Schema, SchemaRef};
diff --git a/datafusion/datasource-parquet/src/mod.rs b/datafusion/datasource-parquet/src/mod.rs
index 260d6ee471..250b36ad6d 100644
--- a/datafusion/datasource-parquet/src/mod.rs
+++ b/datafusion/datasource-parquet/src/mod.rs
@@ -55,10 +55,10 @@ pub use row_filter::build_row_filter;
 pub use row_filter::can_expr_be_pushed_down_with_schemas;
 pub use row_group_filter::RowGroupAccessPlanFilter;
 #[expect(deprecated)]
+pub use schema_coercion::coerce_int96_to_resolution;
 pub use schema_coercion::{
-    Int96Coercer, apply_file_schema_type_coercions, coerce_file_schema_to_string_type,
-    coerce_file_schema_to_view_type, coerce_int96_to_resolution,
-    transform_binary_to_string, transform_schema_to_view,
+    Int96Coercer, apply_file_schema_type_coercions, transform_binary_to_string,
+    transform_schema_to_view,
 };
 pub use sink::ParquetSink;
 pub use virtual_column::ParquetVirtualColumn;
diff --git a/datafusion/datasource-parquet/src/schema_coercion.rs b/datafusion/datasource-parquet/src/schema_coercion.rs
index 4598bb525b..30cd5d7e65 100644
--- a/datafusion/datasource-parquet/src/schema_coercion.rs
+++ b/datafusion/datasource-parquet/src/schema_coercion.rs
@@ -418,118 +418,6 @@ fn coerce_int96_to_resolution_impl(
     Some(transformed_schema)
 }
 
-/// Coerces the file schema if the table schema uses a view type.
-#[deprecated(
-    since = "47.0.0",
-    note = "Use `apply_file_schema_type_coercions` instead"
-)]
-pub fn coerce_file_schema_to_view_type(
-    table_schema: &Schema,
-    file_schema: &Schema,
-) -> Option<Schema> {
-    let mut transform = false;
-    let table_fields: HashMap<_, _> = table_schema
-        .fields
-        .iter()
-        .map(|f| {
-            let dt = f.data_type();
-            if dt.equals_datatype(&DataType::Utf8View)
-                || dt.equals_datatype(&DataType::BinaryView)
-            {
-                transform = true;
-            }
-            (f.name(), dt)
-        })
-        .collect();
-
-    if !transform {
-        return None;
-    }
-
-    let transformed_fields: Vec<Arc<Field>> = file_schema
-        .fields
-        .iter()
-        .map(
-            |field| match (table_fields.get(field.name()), field.data_type()) {
-                (Some(DataType::Utf8View), DataType::Utf8 | DataType::LargeUtf8) => {
-                    field_with_new_type(field, DataType::Utf8View)
-                }
-                (
-                    Some(DataType::BinaryView),
-                    DataType::Binary | DataType::LargeBinary,
-                ) => field_with_new_type(field, DataType::BinaryView),
-                _ => Arc::clone(field),
-            },
-        )
-        .collect();
-
-    Some(Schema::new_with_metadata(
-        transformed_fields,
-        file_schema.metadata.clone(),
-    ))
-}
-
-/// If the table schema uses a string type, coerce the file schema to use a string type.
-///
-/// See [`ParquetFormat::binary_as_string`](crate::file_format::ParquetFormat::binary_as_string) for details
-#[deprecated(
-    since = "47.0.0",
-    note = "Use `apply_file_schema_type_coercions` instead"
-)]
-pub fn coerce_file_schema_to_string_type(
-    table_schema: &Schema,
-    file_schema: &Schema,
-) -> Option<Schema> {
-    let mut transform = false;
-    let table_fields: HashMap<_, _> = table_schema
-        .fields
-        .iter()
-        .map(|f| (f.name(), f.data_type()))
-        .collect();
-    let transformed_fields: Vec<Arc<Field>> = file_schema
-        .fields
-        .iter()
-        .map(
-            |field| match (table_fields.get(field.name()), field.data_type()) {
-                // table schema uses string type, coerce the file schema to use string type
-                (
-                    Some(DataType::Utf8),
-                    DataType::Binary | DataType::LargeBinary | DataType::BinaryView,
-                ) => {
-                    transform = true;
-                    field_with_new_type(field, DataType::Utf8)
-                }
-                // table schema uses large string type, coerce the file schema to use large string type
-                (
-                    Some(DataType::LargeUtf8),
-                    DataType::Binary | DataType::LargeBinary | DataType::BinaryView,
-                ) => {
-                    transform = true;
-                    field_with_new_type(field, DataType::LargeUtf8)
-                }
-                // table schema uses string view type, coerce the file schema to use view type
-                (
-                    Some(DataType::Utf8View),
-                    DataType::Binary | DataType::LargeBinary | DataType::BinaryView,
-                ) => {
-                    transform = true;
-                    field_with_new_type(field, DataType::Utf8View)
-                }
-                _ => Arc::clone(field),
-            },
-        )
-        .collect();
-
-    if !transform {
-        None
-    } else {
-        Some(Schema::new_with_metadata(
-            transformed_fields,
-            file_schema.metadata.clone(),
-        ))
-    }
-}
-
 /// Create a new field with the specified data type, copying the other
 /// properties from the input field
 fn field_with_new_type(field: &FieldRef, new_type: DataType) -> FieldRef {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org