From a6927cf5c17dc60c53e94b5468fecb83023cffeb Mon Sep 17 00:00:00 2001 From: Landon Gingerich Date: Wed, 13 Aug 2025 13:19:47 -0500 Subject: [PATCH 1/4] chore(lint): change from crate to workspace-level `clippy::clone_on_ref_ptr` denies --- Cargo.toml | 1 + datafusion/catalog-listing/src/mod.rs | 3 --- datafusion/catalog/src/lib.rs | 3 --- datafusion/common-runtime/src/lib.rs | 3 --- datafusion/common/src/lib.rs | 3 --- datafusion/core/src/lib.rs | 4 ---- datafusion/datasource-avro/src/mod.rs | 3 --- datafusion/datasource-csv/src/mod.rs | 4 ---- datafusion/datasource-json/src/mod.rs | 4 ---- datafusion/datasource-parquet/src/mod.rs | 4 ---- datafusion/datasource/src/mod.rs | 3 --- datafusion/execution/src/lib.rs | 3 --- datafusion/expr-common/src/lib.rs | 3 --- datafusion/expr/src/lib.rs | 3 --- datafusion/ffi/src/lib.rs | 3 --- datafusion/functions-aggregate-common/src/lib.rs | 3 --- datafusion/functions-aggregate/src/lib.rs | 3 --- datafusion/functions-nested/src/lib.rs | 3 --- datafusion/functions-table/src/lib.rs | 3 --- datafusion/functions-window-common/src/lib.rs | 3 --- datafusion/functions-window/src/lib.rs | 3 --- datafusion/functions/src/lib.rs | 3 --- datafusion/optimizer/src/lib.rs | 3 --- datafusion/physical-expr-common/src/lib.rs | 3 --- datafusion/physical-expr/src/lib.rs | 3 --- datafusion/physical-optimizer/src/lib.rs | 3 --- datafusion/physical-plan/src/lib.rs | 3 --- datafusion/proto-common/src/lib.rs | 3 --- datafusion/proto/src/lib.rs | 3 --- datafusion/spark/src/lib.rs | 2 -- datafusion/sql/src/lib.rs | 3 --- datafusion/sqllogictest/src/lib.rs | 3 --- datafusion/substrait/src/lib.rs | 3 --- 33 files changed, 1 insertion(+), 99 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 133536170878..0739d529adfa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -221,6 +221,7 @@ used_underscore_binding = "warn" or_fun_call = "warn" unnecessary_lazy_evaluations = "warn" uninlined_format_args = "warn" +clone_on_ref_ptr = "deny" [workspace.lints.rust] unexpected_cfgs = { level = "warn", check-cfg = [ diff --git a/datafusion/catalog-listing/src/mod.rs b/datafusion/catalog-listing/src/mod.rs index fb0a960f37b6..cb0d86d8666e 100644 --- a/datafusion/catalog-listing/src/mod.rs +++ b/datafusion/catalog-listing/src/mod.rs @@ -20,8 +20,5 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] pub mod helpers; diff --git a/datafusion/catalog/src/lib.rs b/datafusion/catalog/src/lib.rs index 0394b05277da..0e847a2d500c 100644 --- a/datafusion/catalog/src/lib.rs +++ b/datafusion/catalog/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! Interfaces and default implementations of catalogs and schemas. //! diff --git a/datafusion/common-runtime/src/lib.rs b/datafusion/common-runtime/src/lib.rs index ec8db0bdcd91..889696e49e41 100644 --- a/datafusion/common-runtime/src/lib.rs +++ b/datafusion/common-runtime/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] pub mod common; mod join_set; diff --git a/datafusion/common/src/lib.rs b/datafusion/common/src/lib.rs index 3a558fa86789..0ba23eb59ad3 100644 --- a/datafusion/common/src/lib.rs +++ b/datafusion/common/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] mod column; mod dfschema; diff --git a/datafusion/core/src/lib.rs b/datafusion/core/src/lib.rs index a2a3d2f7e866..c2a3cb011648 100644 --- a/datafusion/core/src/lib.rs +++ b/datafusion/core/src/lib.rs @@ -20,16 +20,12 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -// // Eliminate unnecessary function calls(some may be not cheap) due to `xxx_or` // for performance. Also avoid abusing `xxx_or_else` for readability: // https://github.com/apache/datafusion/issues/15802 #![cfg_attr( not(test), deny( - clippy::clone_on_ref_ptr, clippy::or_fun_call, clippy::unnecessary_lazy_evaluations ) diff --git a/datafusion/datasource-avro/src/mod.rs b/datafusion/datasource-avro/src/mod.rs index 71996f3f0eaa..7d00b14e5119 100644 --- a/datafusion/datasource-avro/src/mod.rs +++ b/datafusion/datasource-avro/src/mod.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! An [Avro](https://avro.apache.org/) based [`FileSource`](datafusion_datasource::file::FileSource) implementation and related functionality. diff --git a/datafusion/datasource-csv/src/mod.rs b/datafusion/datasource-csv/src/mod.rs index 90538d0808b1..29ec7b8d9e26 100644 --- a/datafusion/datasource-csv/src/mod.rs +++ b/datafusion/datasource-csv/src/mod.rs @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] - pub mod file_format; pub mod source; diff --git a/datafusion/datasource-json/src/mod.rs b/datafusion/datasource-json/src/mod.rs index 18bb8792c3ff..35dabfa109fc 100644 --- a/datafusion/datasource-json/src/mod.rs +++ b/datafusion/datasource-json/src/mod.rs @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] - pub mod file_format; pub mod source; diff --git a/datafusion/datasource-parquet/src/mod.rs b/datafusion/datasource-parquet/src/mod.rs index ad59e7261cba..278b7a7a1a0e 100644 --- a/datafusion/datasource-parquet/src/mod.rs +++ b/datafusion/datasource-parquet/src/mod.rs @@ -15,10 +15,6 @@ // specific language governing permissions and limitations // under the License. -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] - pub mod access_plan; pub mod file_format; mod metrics; diff --git a/datafusion/datasource/src/mod.rs b/datafusion/datasource/src/mod.rs index 3cd4a1a6c1c9..0630aa4a3a73 100644 --- a/datafusion/datasource/src/mod.rs +++ b/datafusion/datasource/src/mod.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! A table that uses the `ObjectStore` listing capability //! to get the list of files to process. diff --git a/datafusion/execution/src/lib.rs b/datafusion/execution/src/lib.rs index e971e838a6e5..d6c30e65dbf3 100644 --- a/datafusion/execution/src/lib.rs +++ b/datafusion/execution/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! DataFusion execution configuration and runtime structures diff --git a/datafusion/expr-common/src/lib.rs b/datafusion/expr-common/src/lib.rs index f0bb6f99943b..b7ede39864c8 100644 --- a/datafusion/expr-common/src/lib.rs +++ b/datafusion/expr-common/src/lib.rs @@ -28,9 +28,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] pub mod accumulator; pub mod casts; diff --git a/datafusion/expr/src/lib.rs b/datafusion/expr/src/lib.rs index b4ad8387215e..dbc708307a06 100644 --- a/datafusion/expr/src/lib.rs +++ b/datafusion/expr/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! [DataFusion](https://github.com/apache/datafusion) //! is an extensible query execution framework that uses diff --git a/datafusion/ffi/src/lib.rs b/datafusion/ffi/src/lib.rs index ff641e8315c7..b0c7d19e8484 100644 --- a/datafusion/ffi/src/lib.rs +++ b/datafusion/ffi/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] pub mod arrow_wrappers; pub mod catalog_provider; diff --git a/datafusion/functions-aggregate-common/src/lib.rs b/datafusion/functions-aggregate-common/src/lib.rs index 203ae98fe1ed..bccc54924037 100644 --- a/datafusion/functions-aggregate-common/src/lib.rs +++ b/datafusion/functions-aggregate-common/src/lib.rs @@ -27,9 +27,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] pub mod accumulator; pub mod aggregate; diff --git a/datafusion/functions-aggregate/src/lib.rs b/datafusion/functions-aggregate/src/lib.rs index b5bb69f6da9d..cedb6d7f72e6 100644 --- a/datafusion/functions-aggregate/src/lib.rs +++ b/datafusion/functions-aggregate/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Aggregate Function packages for [DataFusion]. //! diff --git a/datafusion/functions-nested/src/lib.rs b/datafusion/functions-nested/src/lib.rs index 1d3f11b50c61..b9d4d7dd05d5 100644 --- a/datafusion/functions-nested/src/lib.rs +++ b/datafusion/functions-nested/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Nested type Functions for [DataFusion]. //! diff --git a/datafusion/functions-table/src/lib.rs b/datafusion/functions-table/src/lib.rs index 36fcdc7ede56..311b9d310f39 100644 --- a/datafusion/functions-table/src/lib.rs +++ b/datafusion/functions-table/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] pub mod generate_series; diff --git a/datafusion/functions-window-common/src/lib.rs b/datafusion/functions-window-common/src/lib.rs index 7f668a20a76a..6f2a1ac0f33f 100644 --- a/datafusion/functions-window-common/src/lib.rs +++ b/datafusion/functions-window-common/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! Common user-defined window functionality for [DataFusion] //! diff --git a/datafusion/functions-window/src/lib.rs b/datafusion/functions-window/src/lib.rs index 10e09542d7c5..718b0bf1587b 100644 --- a/datafusion/functions-window/src/lib.rs +++ b/datafusion/functions-window/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! Window Function packages for [DataFusion]. //! diff --git a/datafusion/functions/src/lib.rs b/datafusion/functions/src/lib.rs index 51cd5df8060d..d8d07687a77f 100644 --- a/datafusion/functions/src/lib.rs +++ b/datafusion/functions/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Function packages for [DataFusion]. //! diff --git a/datafusion/optimizer/src/lib.rs b/datafusion/optimizer/src/lib.rs index 280010e3d92c..a5bf8d0b9e84 100644 --- a/datafusion/optimizer/src/lib.rs +++ b/datafusion/optimizer/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! # DataFusion Optimizer //! diff --git a/datafusion/physical-expr-common/src/lib.rs b/datafusion/physical-expr-common/src/lib.rs index 86d4487f4c12..850cfa8e5459 100644 --- a/datafusion/physical-expr-common/src/lib.rs +++ b/datafusion/physical-expr-common/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Physical Expr Common packages for [DataFusion] //! This package contains high level PhysicalExpr trait diff --git a/datafusion/physical-expr/src/lib.rs b/datafusion/physical-expr/src/lib.rs index 845c358d7e58..c213da9135fd 100644 --- a/datafusion/physical-expr/src/lib.rs +++ b/datafusion/physical-expr/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] // Backward compatibility pub mod aggregate; diff --git a/datafusion/physical-optimizer/src/lib.rs b/datafusion/physical-optimizer/src/lib.rs index c828cc696063..57441d59948a 100644 --- a/datafusion/physical-optimizer/src/lib.rs +++ b/datafusion/physical-optimizer/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] pub mod aggregate_statistics; pub mod coalesce_async_exec_input; diff --git a/datafusion/physical-plan/src/lib.rs b/datafusion/physical-plan/src/lib.rs index afe61541fc45..6b159d09104a 100644 --- a/datafusion/physical-plan/src/lib.rs +++ b/datafusion/physical-plan/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Traits for physical query plan, supporting parallel execution for partitioned relations. //! diff --git a/datafusion/proto-common/src/lib.rs b/datafusion/proto-common/src/lib.rs index 6400e4bdc66d..99b4cd0fc790 100644 --- a/datafusion/proto-common/src/lib.rs +++ b/datafusion/proto-common/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Serialize / Deserialize DataFusion Primitive Types to bytes //! diff --git a/datafusion/proto/src/lib.rs b/datafusion/proto/src/lib.rs index b4d72aa1b6cb..247a3e86b029 100644 --- a/datafusion/proto/src/lib.rs +++ b/datafusion/proto/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Serialize / Deserialize DataFusion Plans to bytes //! diff --git a/datafusion/spark/src/lib.rs b/datafusion/spark/src/lib.rs index 4ce9be1263ef..c733559cbb7f 100644 --- a/datafusion/spark/src/lib.rs +++ b/datafusion/spark/src/lib.rs @@ -20,8 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make cheap clones clear: https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! Spark Expression packages for [DataFusion]. //! diff --git a/datafusion/sql/src/lib.rs b/datafusion/sql/src/lib.rs index 7e11f160a397..6f661899fdac 100644 --- a/datafusion/sql/src/lib.rs +++ b/datafusion/sql/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![deny(clippy::clone_on_ref_ptr)] //! This crate provides: //! diff --git a/datafusion/sqllogictest/src/lib.rs b/datafusion/sqllogictest/src/lib.rs index 3c786d6bdaac..c393bea3553c 100644 --- a/datafusion/sqllogictest/src/lib.rs +++ b/datafusion/sqllogictest/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! DataFusion sqllogictest driver diff --git a/datafusion/substrait/src/lib.rs b/datafusion/substrait/src/lib.rs index 0f2fbf199be3..a7493a48e4c5 100644 --- a/datafusion/substrait/src/lib.rs +++ b/datafusion/substrait/src/lib.rs @@ -20,9 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -// Make sure fast / cheap clones on Arc are explicit: -// https://github.com/apache/datafusion/issues/11143 -#![cfg_attr(not(test), deny(clippy::clone_on_ref_ptr))] //! Serialize / Deserialize DataFusion Plans to [Substrait.io] //! From 5479cbf310691d5e16f38b0bd5f9e7a9c5621f26 Mon Sep 17 00:00:00 2001 From: Landon Gingerich Date: Wed, 13 Aug 2025 13:23:29 -0500 Subject: [PATCH 2/4] fix(lint): fix `clippy::clone_on_ref_ptr` errors --- benchmarks/src/bin/external_aggr.rs | 2 +- benchmarks/src/imdb/run.rs | 2 +- benchmarks/src/sort_tpch.rs | 2 +- benchmarks/src/tpch/run.rs | 2 +- test-utils/src/data_gen.rs | 2 +- test-utils/src/lib.rs | 3 ++- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/benchmarks/src/bin/external_aggr.rs b/benchmarks/src/bin/external_aggr.rs index 0e519367badb..56f6aa200709 100644 --- a/benchmarks/src/bin/external_aggr.rs +++ b/benchmarks/src/bin/external_aggr.rs @@ -280,7 +280,7 @@ impl ExternalAggrConfig { displayable(physical_plan.as_ref()).indent(true) ); } - let result = collect(physical_plan.clone(), state.task_ctx()).await?; + let result = collect(Arc::clone(&physical_plan), state.task_ctx()).await?; if debug { println!( "=== Physical plan with metrics ===\n{}\n", diff --git a/benchmarks/src/imdb/run.rs b/benchmarks/src/imdb/run.rs index 90e0947f64f6..7fb5fe67de45 100644 --- a/benchmarks/src/imdb/run.rs +++ b/benchmarks/src/imdb/run.rs @@ -394,7 +394,7 @@ impl RunOpt { displayable(physical_plan.as_ref()).indent(true) ); } - let result = collect(physical_plan.clone(), state.task_ctx()).await?; + let result = collect(Arc::clone(&physical_plan), state.task_ctx()).await?; if debug { println!( "=== Physical plan with metrics ===\n{}\n", diff --git a/benchmarks/src/sort_tpch.rs b/benchmarks/src/sort_tpch.rs index 09b5a676bbff..860aa9ccf60e 100644 --- a/benchmarks/src/sort_tpch.rs +++ b/benchmarks/src/sort_tpch.rs @@ -301,7 +301,7 @@ impl RunOpt { let mut row_count = 0; - let mut stream = execute_stream(physical_plan.clone(), state.task_ctx())?; + let mut stream = execute_stream(Arc::clone(&physical_plan), state.task_ctx())?; while let Some(batch) = stream.next().await { row_count += batch?.num_rows(); } diff --git a/benchmarks/src/tpch/run.rs b/benchmarks/src/tpch/run.rs index 30ecb4d33baa..6e0e0999b6c8 100644 --- a/benchmarks/src/tpch/run.rs +++ b/benchmarks/src/tpch/run.rs @@ -235,7 +235,7 @@ impl RunOpt { displayable(physical_plan.as_ref()).indent(true) ); } - let result = collect(physical_plan.clone(), state.task_ctx()).await?; + let result = collect(Arc::clone(&physical_plan), state.task_ctx()).await?; if debug { println!( "=== Physical plan with metrics ===\n{}\n", diff --git a/test-utils/src/data_gen.rs b/test-utils/src/data_gen.rs index 2228010b28dd..c3498127d10b 100644 --- a/test-utils/src/data_gen.rs +++ b/test-utils/src/data_gen.rs @@ -298,7 +298,7 @@ impl AccessLogGenerator { /// Return the schema of the [`RecordBatch`]es created pub fn schema(&self) -> SchemaRef { - self.schema.clone() + Arc::clone(&self.schema) } /// Limit the maximum batch size diff --git a/test-utils/src/lib.rs b/test-utils/src/lib.rs index be2bc0712afb..6137bbb06673 100644 --- a/test-utils/src/lib.rs +++ b/test-utils/src/lib.rs @@ -21,6 +21,7 @@ use arrow::record_batch::RecordBatch; use datafusion_common::cast::as_int32_array; use rand::prelude::StdRng; use rand::{Rng, SeedableRng}; +use std::sync::Arc; pub mod array_gen; mod data_gen; @@ -66,7 +67,7 @@ pub fn add_empty_batches( .into_iter() .flat_map(|batch| { // insert 0, or 1 empty batches before and after the current batch - let empty_batch = RecordBatch::new_empty(schema.clone()); + let empty_batch = RecordBatch::new_empty(Arc::clone(&schema)); std::iter::repeat_n(empty_batch.clone(), rng.random_range(0..2)) .chain(std::iter::once(batch)) .chain(std::iter::repeat_n(empty_batch, rng.random_range(0..2))) From 02bda3ce93f20c52618f3d582767d11e6e7e25e5 Mon Sep 17 00:00:00 2001 From: Landon Gingerich Date: Wed, 13 Aug 2025 13:23:57 -0500 Subject: [PATCH 3/4] chore: cargo fmt --- datafusion/core/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/datafusion/core/src/lib.rs b/datafusion/core/src/lib.rs index c2a3cb011648..a1573dee54e7 100644 --- a/datafusion/core/src/lib.rs +++ b/datafusion/core/src/lib.rs @@ -25,10 +25,7 @@ // https://github.com/apache/datafusion/issues/15802 #![cfg_attr( not(test), - deny( - clippy::or_fun_call, - clippy::unnecessary_lazy_evaluations - ) + deny(clippy::or_fun_call, clippy::unnecessary_lazy_evaluations) )] #![warn(missing_docs, clippy::needless_borrow)] From 683ac59897fa5a645ac6cfb194f7e6887afb9a48 Mon Sep 17 00:00:00 2001 From: Landon Gingerich Date: Wed, 13 Aug 2025 19:17:51 -0500 Subject: [PATCH 4/4] chore(lint): disable `clippy::clone_on_ref_ptr` in tests --- datafusion/catalog-listing/src/mod.rs | 1 + datafusion/catalog/src/lib.rs | 1 + datafusion/common-runtime/src/lib.rs | 1 + datafusion/common/src/lib.rs | 1 + datafusion/core/src/lib.rs | 1 + datafusion/datasource-avro/src/mod.rs | 1 + datafusion/datasource-csv/src/mod.rs | 2 ++ datafusion/datasource-json/src/mod.rs | 2 ++ datafusion/datasource-parquet/src/mod.rs | 2 ++ datafusion/datasource/src/mod.rs | 1 + datafusion/doc/src/lib.rs | 1 + datafusion/execution/src/lib.rs | 1 + datafusion/expr-common/src/lib.rs | 1 + datafusion/expr/src/lib.rs | 1 + datafusion/ffi/src/lib.rs | 1 + datafusion/functions-aggregate-common/src/lib.rs | 1 + datafusion/functions-aggregate/src/lib.rs | 1 + datafusion/functions-nested/src/lib.rs | 1 + datafusion/functions-table/src/lib.rs | 1 + datafusion/functions-window-common/src/lib.rs | 1 + datafusion/functions-window/src/lib.rs | 1 + datafusion/functions/src/lib.rs | 1 + datafusion/macros/src/user_doc.rs | 1 + datafusion/optimizer/src/lib.rs | 1 + datafusion/optimizer/tests/optimizer_integration.rs | 2 ++ datafusion/physical-expr-common/src/lib.rs | 1 + datafusion/physical-expr/src/lib.rs | 1 + datafusion/physical-optimizer/src/lib.rs | 1 + datafusion/physical-plan/src/lib.rs | 1 + datafusion/proto-common/src/lib.rs | 1 + datafusion/proto/src/lib.rs | 1 + datafusion/pruning/src/lib.rs | 2 ++ datafusion/session/src/lib.rs | 2 ++ datafusion/spark/src/lib.rs | 1 + datafusion/sql/src/lib.rs | 1 + datafusion/sql/tests/cases/plan_to_sql.rs | 2 ++ datafusion/sqllogictest/src/lib.rs | 1 + datafusion/substrait/src/lib.rs | 1 + datafusion/wasmtest/src/lib.rs | 1 + 39 files changed, 46 insertions(+) diff --git a/datafusion/catalog-listing/src/mod.rs b/datafusion/catalog-listing/src/mod.rs index cb0d86d8666e..ff98b1ff0d87 100644 --- a/datafusion/catalog-listing/src/mod.rs +++ b/datafusion/catalog-listing/src/mod.rs @@ -20,5 +20,6 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod helpers; diff --git a/datafusion/catalog/src/lib.rs b/datafusion/catalog/src/lib.rs index 0e847a2d500c..02f75f353630 100644 --- a/datafusion/catalog/src/lib.rs +++ b/datafusion/catalog/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Interfaces and default implementations of catalogs and schemas. //! diff --git a/datafusion/common-runtime/src/lib.rs b/datafusion/common-runtime/src/lib.rs index 889696e49e41..a68f925c331b 100644 --- a/datafusion/common-runtime/src/lib.rs +++ b/datafusion/common-runtime/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod common; mod join_set; diff --git a/datafusion/common/src/lib.rs b/datafusion/common/src/lib.rs index 0ba23eb59ad3..f942758115f9 100644 --- a/datafusion/common/src/lib.rs +++ b/datafusion/common/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] mod column; mod dfschema; diff --git a/datafusion/core/src/lib.rs b/datafusion/core/src/lib.rs index a1573dee54e7..3547a72cefaf 100644 --- a/datafusion/core/src/lib.rs +++ b/datafusion/core/src/lib.rs @@ -27,6 +27,7 @@ not(test), deny(clippy::or_fun_call, clippy::unnecessary_lazy_evaluations) )] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] #![warn(missing_docs, clippy::needless_borrow)] //! [DataFusion] is an extensible query engine written in Rust that diff --git a/datafusion/datasource-avro/src/mod.rs b/datafusion/datasource-avro/src/mod.rs index 7d00b14e5119..ff4984992199 100644 --- a/datafusion/datasource-avro/src/mod.rs +++ b/datafusion/datasource-avro/src/mod.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! An [Avro](https://avro.apache.org/) based [`FileSource`](datafusion_datasource::file::FileSource) implementation and related functionality. diff --git a/datafusion/datasource-csv/src/mod.rs b/datafusion/datasource-csv/src/mod.rs index 29ec7b8d9e26..8ecbe4ea817e 100644 --- a/datafusion/datasource-csv/src/mod.rs +++ b/datafusion/datasource-csv/src/mod.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + pub mod file_format; pub mod source; diff --git a/datafusion/datasource-json/src/mod.rs b/datafusion/datasource-json/src/mod.rs index 35dabfa109fc..93cd0149571d 100644 --- a/datafusion/datasource-json/src/mod.rs +++ b/datafusion/datasource-json/src/mod.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + pub mod file_format; pub mod source; diff --git a/datafusion/datasource-parquet/src/mod.rs b/datafusion/datasource-parquet/src/mod.rs index 278b7a7a1a0e..a2c2e33cf81e 100644 --- a/datafusion/datasource-parquet/src/mod.rs +++ b/datafusion/datasource-parquet/src/mod.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + pub mod access_plan; pub mod file_format; mod metrics; diff --git a/datafusion/datasource/src/mod.rs b/datafusion/datasource/src/mod.rs index 0630aa4a3a73..c59d26d94d75 100644 --- a/datafusion/datasource/src/mod.rs +++ b/datafusion/datasource/src/mod.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! A table that uses the `ObjectStore` listing capability //! to get the list of files to process. diff --git a/datafusion/doc/src/lib.rs b/datafusion/doc/src/lib.rs index 9a2c5656bae9..4a6531ba9f1a 100644 --- a/datafusion/doc/src/lib.rs +++ b/datafusion/doc/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] #[allow(rustdoc::broken_intra_doc_links)] /// Documentation for use by [`ScalarUDFImpl`](ScalarUDFImpl), diff --git a/datafusion/execution/src/lib.rs b/datafusion/execution/src/lib.rs index d6c30e65dbf3..d7565b2281f6 100644 --- a/datafusion/execution/src/lib.rs +++ b/datafusion/execution/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! DataFusion execution configuration and runtime structures diff --git a/datafusion/expr-common/src/lib.rs b/datafusion/expr-common/src/lib.rs index b7ede39864c8..125a6c86ad81 100644 --- a/datafusion/expr-common/src/lib.rs +++ b/datafusion/expr-common/src/lib.rs @@ -28,6 +28,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod accumulator; pub mod casts; diff --git a/datafusion/expr/src/lib.rs b/datafusion/expr/src/lib.rs index dbc708307a06..fc0d40128a86 100644 --- a/datafusion/expr/src/lib.rs +++ b/datafusion/expr/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! [DataFusion](https://github.com/apache/datafusion) //! is an extensible query execution framework that uses diff --git a/datafusion/ffi/src/lib.rs b/datafusion/ffi/src/lib.rs index b0c7d19e8484..f19d7ed8a1a2 100644 --- a/datafusion/ffi/src/lib.rs +++ b/datafusion/ffi/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod arrow_wrappers; pub mod catalog_provider; diff --git a/datafusion/functions-aggregate-common/src/lib.rs b/datafusion/functions-aggregate-common/src/lib.rs index bccc54924037..cf360fcf103d 100644 --- a/datafusion/functions-aggregate-common/src/lib.rs +++ b/datafusion/functions-aggregate-common/src/lib.rs @@ -27,6 +27,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod accumulator; pub mod aggregate; diff --git a/datafusion/functions-aggregate/src/lib.rs b/datafusion/functions-aggregate/src/lib.rs index cedb6d7f72e6..e44df76ed835 100644 --- a/datafusion/functions-aggregate/src/lib.rs +++ b/datafusion/functions-aggregate/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Aggregate Function packages for [DataFusion]. //! diff --git a/datafusion/functions-nested/src/lib.rs b/datafusion/functions-nested/src/lib.rs index b9d4d7dd05d5..29ae3d427119 100644 --- a/datafusion/functions-nested/src/lib.rs +++ b/datafusion/functions-nested/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Nested type Functions for [DataFusion]. //! diff --git a/datafusion/functions-table/src/lib.rs b/datafusion/functions-table/src/lib.rs index 311b9d310f39..d817f2355cf2 100644 --- a/datafusion/functions-table/src/lib.rs +++ b/datafusion/functions-table/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod generate_series; diff --git a/datafusion/functions-window-common/src/lib.rs b/datafusion/functions-window-common/src/lib.rs index 6f2a1ac0f33f..5c3d6c052e14 100644 --- a/datafusion/functions-window-common/src/lib.rs +++ b/datafusion/functions-window-common/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Common user-defined window functionality for [DataFusion] //! diff --git a/datafusion/functions-window/src/lib.rs b/datafusion/functions-window/src/lib.rs index 718b0bf1587b..9e3502c2fd2a 100644 --- a/datafusion/functions-window/src/lib.rs +++ b/datafusion/functions-window/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Window Function packages for [DataFusion]. //! diff --git a/datafusion/functions/src/lib.rs b/datafusion/functions/src/lib.rs index d8d07687a77f..d51049bd1162 100644 --- a/datafusion/functions/src/lib.rs +++ b/datafusion/functions/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Function packages for [DataFusion]. //! diff --git a/datafusion/macros/src/user_doc.rs b/datafusion/macros/src/user_doc.rs index 31cf9bb1b750..b497c4e47b86 100644 --- a/datafusion/macros/src/user_doc.rs +++ b/datafusion/macros/src/user_doc.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] extern crate proc_macro; use datafusion_expr::scalar_doc_sections::doc_sections_const; diff --git a/datafusion/optimizer/src/lib.rs b/datafusion/optimizer/src/lib.rs index a5bf8d0b9e84..0cdaafe6998e 100644 --- a/datafusion/optimizer/src/lib.rs +++ b/datafusion/optimizer/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! # DataFusion Optimizer //! diff --git a/datafusion/optimizer/tests/optimizer_integration.rs b/datafusion/optimizer/tests/optimizer_integration.rs index deda8fadbec3..a96b7a8c7758 100644 --- a/datafusion/optimizer/tests/optimizer_integration.rs +++ b/datafusion/optimizer/tests/optimizer_integration.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + use std::any::Any; use std::collections::HashMap; use std::sync::Arc; diff --git a/datafusion/physical-expr-common/src/lib.rs b/datafusion/physical-expr-common/src/lib.rs index 850cfa8e5459..476077af4466 100644 --- a/datafusion/physical-expr-common/src/lib.rs +++ b/datafusion/physical-expr-common/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Physical Expr Common packages for [DataFusion] //! This package contains high level PhysicalExpr trait diff --git a/datafusion/physical-expr/src/lib.rs b/datafusion/physical-expr/src/lib.rs index c213da9135fd..aab06d9820cd 100644 --- a/datafusion/physical-expr/src/lib.rs +++ b/datafusion/physical-expr/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] // Backward compatibility pub mod aggregate; diff --git a/datafusion/physical-optimizer/src/lib.rs b/datafusion/physical-optimizer/src/lib.rs index 57441d59948a..419581eb3531 100644 --- a/datafusion/physical-optimizer/src/lib.rs +++ b/datafusion/physical-optimizer/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] pub mod aggregate_statistics; pub mod coalesce_async_exec_input; diff --git a/datafusion/physical-plan/src/lib.rs b/datafusion/physical-plan/src/lib.rs index 6b159d09104a..bd67d7c54c07 100644 --- a/datafusion/physical-plan/src/lib.rs +++ b/datafusion/physical-plan/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Traits for physical query plan, supporting parallel execution for partitioned relations. //! diff --git a/datafusion/proto-common/src/lib.rs b/datafusion/proto-common/src/lib.rs index 99b4cd0fc790..06e923adfc64 100644 --- a/datafusion/proto-common/src/lib.rs +++ b/datafusion/proto-common/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Serialize / Deserialize DataFusion Primitive Types to bytes //! diff --git a/datafusion/proto/src/lib.rs b/datafusion/proto/src/lib.rs index 247a3e86b029..0cb40293c954 100644 --- a/datafusion/proto/src/lib.rs +++ b/datafusion/proto/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Serialize / Deserialize DataFusion Plans to bytes //! diff --git a/datafusion/pruning/src/lib.rs b/datafusion/pruning/src/lib.rs index cec4fab2262f..543915082eac 100644 --- a/datafusion/pruning/src/lib.rs +++ b/datafusion/pruning/src/lib.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + mod file_pruner; mod pruning_predicate; diff --git a/datafusion/session/src/lib.rs b/datafusion/session/src/lib.rs index a2e1d9ca3ae8..42a0d67b55db 100644 --- a/datafusion/session/src/lib.rs +++ b/datafusion/session/src/lib.rs @@ -34,6 +34,8 @@ //! * Runtime environment configuration //! * Query state persistence +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + pub mod session; pub use crate::session::{Session, SessionStore}; diff --git a/datafusion/spark/src/lib.rs b/datafusion/spark/src/lib.rs index c733559cbb7f..738d8413e4c9 100644 --- a/datafusion/spark/src/lib.rs +++ b/datafusion/spark/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Spark Expression packages for [DataFusion]. //! diff --git a/datafusion/sql/src/lib.rs b/datafusion/sql/src/lib.rs index 6f661899fdac..bffad4c99719 100644 --- a/datafusion/sql/src/lib.rs +++ b/datafusion/sql/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! This crate provides: //! diff --git a/datafusion/sql/tests/cases/plan_to_sql.rs b/datafusion/sql/tests/cases/plan_to_sql.rs index 22924540ba6b..6d77912a4e12 100644 --- a/datafusion/sql/tests/cases/plan_to_sql.rs +++ b/datafusion/sql/tests/cases/plan_to_sql.rs @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] + use arrow::datatypes::{DataType, Field, Schema}; use datafusion_common::{ assert_contains, Column, DFSchema, DFSchemaRef, DataFusionError, Result, diff --git a/datafusion/sqllogictest/src/lib.rs b/datafusion/sqllogictest/src/lib.rs index c393bea3553c..2f33a4f5cf39 100644 --- a/datafusion/sqllogictest/src/lib.rs +++ b/datafusion/sqllogictest/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! DataFusion sqllogictest driver diff --git a/datafusion/substrait/src/lib.rs b/datafusion/substrait/src/lib.rs index a7493a48e4c5..8686e5ed1471 100644 --- a/datafusion/substrait/src/lib.rs +++ b/datafusion/substrait/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] //! Serialize / Deserialize DataFusion Plans to [Substrait.io] //! diff --git a/datafusion/wasmtest/src/lib.rs b/datafusion/wasmtest/src/lib.rs index e30a1046ab27..497112e913bb 100644 --- a/datafusion/wasmtest/src/lib.rs +++ b/datafusion/wasmtest/src/lib.rs @@ -20,6 +20,7 @@ html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg" )] #![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(test, allow(clippy::clone_on_ref_ptr))] extern crate wasm_bindgen;