[
https://issues.apache.org/jira/browse/SPARK-28663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yuming Wang updated SPARK-28663:
Description:
||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]
was:
||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
> 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
>Priority: Major
>
> ||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