diff --git a/core/src/execution/datafusion/expressions/covariance.rs b/core/src/execution/datafusion/expressions/covariance.rs index 5a10371c4..9b24555b1 100644 --- a/core/src/execution/datafusion/expressions/covariance.rs +++ b/core/src/execution/datafusion/expressions/covariance.rs @@ -17,21 +17,22 @@ //! Defines physical expressions that can evaluated at runtime during query execution -use std::any::Any; -use std::sync::Arc; +use std::{any::Any, sync::Arc}; -use arrow::array::Float64Array; use arrow::{ - array::{ArrayRef, Int64Array}, + array::{ArrayRef, Float64Array, Int64Array}, compute::cast, - datatypes::DataType, - datatypes::Field, + datatypes::{DataType, Field}, }; use datafusion::logical_expr::Accumulator; -use datafusion_common::{downcast_value, unwrap_or_internal_err, ScalarValue}; -use datafusion_common::{DataFusionError, Result}; -use datafusion_physical_expr::{aggregate::utils::down_cast_any_ref, expressions::format_state_name, AggregateExpr, PhysicalExpr}; -use datafusion_physical_expr::expressions::StatsType; +use datafusion_common::{ + downcast_value, unwrap_or_internal_err, DataFusionError, Result, ScalarValue, +}; +use datafusion_physical_expr::{ + aggregate::utils::down_cast_any_ref, + expressions::{format_state_name, StatsType}, + AggregateExpr, PhysicalExpr, +}; /// COVAR and COVAR_SAMP aggregate expression #[derive(Debug, Clone)] @@ -119,9 +120,7 @@ impl PartialEq for Covariance { fn eq(&self, other: &dyn Any) -> bool { down_cast_any_ref(other) .downcast_ref::() - .map(|x| { - self.name == x.name && self.expr1.eq(&x.expr1) && self.expr2.eq(&x.expr2) - }) + .map(|x| self.name == x.name && self.expr1.eq(&x.expr1) && self.expr2.eq(&x.expr2)) .unwrap_or(false) } } @@ -198,9 +197,7 @@ impl PartialEq for CovariancePop { fn eq(&self, other: &dyn Any) -> bool { down_cast_any_ref(other) .downcast_ref::() - .map(|x| { - self.name == x.name && self.expr1.eq(&x.expr1) && self.expr2.eq(&x.expr2) - }) + .map(|x| self.name == x.name && self.expr1.eq(&x.expr1) && self.expr2.eq(&x.expr2)) .unwrap_or(false) } } diff --git a/core/src/execution/datafusion/expressions/mod.rs b/core/src/execution/datafusion/expressions/mod.rs index 7cbfd4465..80294d81a 100644 --- a/core/src/execution/datafusion/expressions/mod.rs +++ b/core/src/execution/datafusion/expressions/mod.rs @@ -27,9 +27,9 @@ pub use normalize_nan::NormalizeNaNAndZero; pub mod avg; pub mod avg_decimal; pub mod bloom_filter_might_contain; +pub mod covariance; pub mod strings; pub mod subquery; pub mod sum_decimal; pub mod temporal; mod utils; -pub mod covariance; diff --git a/core/src/execution/datafusion/planner.rs b/core/src/execution/datafusion/planner.rs index bdb7081be..556735f78 100644 --- a/core/src/execution/datafusion/planner.rs +++ b/core/src/execution/datafusion/planner.rs @@ -59,12 +59,11 @@ use crate::{ expressions::{ avg::Avg, avg_decimal::AvgDecimal, - covariance::Covariance, - covariance::CovariancePop, bitwise_not::BitwiseNotExpr, bloom_filter_might_contain::BloomFilterMightContain, cast::Cast, checkoverflow::CheckOverflow, + covariance::{Covariance, CovariancePop}, if_expr::IfExpr, scalar_funcs::create_comet_physical_fun, strings::{Contains, EndsWith, Like, StartsWith, StringSpaceExec, SubstringExec},