amaliujia commented on code in PR #41474:
URL: https://github.com/apache/spark/pull/41474#discussion_r1220762462


##########
sql/core/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -1043,6 +1043,171 @@ object functions {
    */
   def var_pop(columnName: String): Column = var_pop(Column(columnName))
 
+  /**
+   * Aggregate function: returns the average of the independent variable for 
non-null pairs
+   * in a group, where `y` is the dependent variable and `x` is the 
independent variable.
+   *
+   * @group agg_funcs
+   * @since 3.5.0
+   */
+  def regr_avgx(y: Column, x: Column): Column = withAggregateFunction { 
RegrAvgX(y.expr, x.expr) }
+
+  /**
+   * Aggregate function: returns the average of the independent variable for 
non-null pairs
+   * in a group, where `y` is the dependent variable and `x` is the 
independent variable.
+   *
+   * @group agg_funcs
+   * @since 3.5.0
+   */
+  def regr_avgx(y: String, x: String): Column = regr_avgx(Column(y), Column(x))

Review Comment:
   @zhengruifeng could you clarify it? Do we usually only care string version 
in Python side?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to