Yuming Wang created SPARK-28663:
-----------------------------------

             Summary: Aggregate Functions for Statistics
                 Key: SPARK-28663
                 URL: https://issues.apache.org/jira/browse/SPARK-28663
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Yuming Wang


||Function||Argument Type||Return Type||Partial Mode||Description||
|{{corr(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|correlation coefficient|
|{{covar_pop(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|population covariance|
|{{covar_samp(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|sample covariance|
|{{regr_avgx(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|average of the independent variable ({{sum(_{{X}}_)/_{{N}}_}})|
|{{regr_avgy(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|average of the dependent variable ({{sum(_{{Y}}_)/_{{N}}_}})|
|{{regr_count(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{bigint}}|Yes|number of 
input rows in which both expressions are nonnull|
|{{regr_intercept(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|y-intercept of the least-squares-fit linear equation determined 
by the (_{{X}}_, _{{Y}}_) pairs|
|{{regr_r2(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|square of the correlation coefficient|
|{{regr_slope(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|slope of the least-squares-fit linear equation determined by 
the (_{{X}}_, _{{Y}}_) pairs|
|{{regr_sxx(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|{{sum(_{{X}}_^2) - sum(_{{X}}_)^2/_{{N}}_}} (“sum of squares” 
of the independent variable)|
|{{regr_sxy(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|{{sum(_{{X}}_*_{{Y}}_) - sum(_{{X}}_) * sum(_{{Y}}_)/_{{N}}_}} 
(“sum of products”of independent times dependent variable)|
|{{regr_syy(_{{Y}}_, _{{X}}_)}}|{{double precision}}|{{double 
precision}}|Yes|{{sum(_{{Y}}_^2) - sum(_{{Y}}_)^2/_{{N}}_}} (“sum of squares” 
of the dependent variable)|


https://www.postgresql.org/docs/11/functions-aggregate.html#FUNCTIONS-AGGREGATE-STATISTICS-TABLE



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to