From 3e5cb0a0a02a217d4cec66b286184de213b6e1a9 Mon Sep 17 00:00:00 2001 From: jayzhan211 Date: Sun, 5 May 2024 22:49:48 +0800 Subject: [PATCH] addres comments Signed-off-by: jayzhan211 --- datafusion/functions-aggregate/src/covariance.rs | 9 ++++----- datafusion/physical-expr-common/src/aggregate/stats.rs | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/datafusion/functions-aggregate/src/covariance.rs b/datafusion/functions-aggregate/src/covariance.rs index dd8d1e664d44..130b193996b6 100644 --- a/datafusion/functions-aggregate/src/covariance.rs +++ b/datafusion/functions-aggregate/src/covariance.rs @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -//! Defines the covariance aggregations. +//! [`CovarianceSample`]: covariance sample aggregations. use std::fmt::Debug; @@ -53,7 +53,6 @@ impl Debug for CovarianceSample { f.debug_struct("CovarianceSample") .field("name", &self.name()) .field("signature", &self.signature) - .field("accumulator", &"") .finish() } } @@ -67,7 +66,7 @@ impl Default for CovarianceSample { impl CovarianceSample { pub fn new() -> Self { Self { - aliases: vec![String::from("covar_samp")], + aliases: vec![String::from("covar")], signature: Signature::uniform(2, NUMERICS.to_vec(), Volatility::Immutable), } } @@ -79,7 +78,7 @@ impl AggregateUDFImpl for CovarianceSample { } fn name(&self) -> &str { - "covar" + "covar_samp" } fn signature(&self) -> &Signature { @@ -122,7 +121,7 @@ impl AggregateUDFImpl for CovarianceSample { } /// An accumulator to compute covariance -/// The algrithm used is an online implementation and numerically stable. It is derived from the following paper +/// The algorithm used is an online implementation and numerically stable. It is derived from the following paper /// for calculating variance: /// Welford, B. P. (1962). "Note on a method for calculating corrected sums of squares and products". /// Technometrics. 4 (3): 419–420. doi:10.2307/1266577. JSTOR 1266577. diff --git a/datafusion/physical-expr-common/src/aggregate/stats.rs b/datafusion/physical-expr-common/src/aggregate/stats.rs index 98baaccffe81..6a11ebe36c5f 100644 --- a/datafusion/physical-expr-common/src/aggregate/stats.rs +++ b/datafusion/physical-expr-common/src/aggregate/stats.rs @@ -15,6 +15,7 @@ // specific language governing permissions and limitations // under the License. +/// TODO: Move this to functions-aggregate module /// Enum used for differentiating population and sample for statistical functions #[derive(Debug, Clone, Copy)] pub enum StatsType {