Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Huaxin Gao committed Apr 1, 2024
1 parent 06bbb36 commit a80cee2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
29 changes: 13 additions & 16 deletions core/src/execution/datafusion/expressions/covariance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -119,9 +120,7 @@ impl PartialEq<dyn Any> for Covariance {
fn eq(&self, other: &dyn Any) -> bool {
down_cast_any_ref(other)
.downcast_ref::<Self>()
.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)
}
}
Expand Down Expand Up @@ -198,9 +197,7 @@ impl PartialEq<dyn Any> for CovariancePop {
fn eq(&self, other: &dyn Any) -> bool {
down_cast_any_ref(other)
.downcast_ref::<Self>()
.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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/execution/datafusion/expressions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
3 changes: 1 addition & 2 deletions core/src/execution/datafusion/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit a80cee2

Please sign in to comment.