HyukjinKwon commented on a change in pull request #34229:
URL: https://github.com/apache/spark/pull/34229#discussion_r725439515



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/functions.scala
##########
@@ -673,6 +673,23 @@ object functions {
    */
   def max(columnName: String): Column = max(Column(columnName))
 
+  /**
+   * Aggregate function: returns the value associated with the maximum value 
of ord.
+   *
+   * @group agg_funcs
+   * @since 3.3.0
+   */
+  def max_by(e: Column, ord: Column): Column = withAggregateFunction { 
MaxBy(e.expr, ord.expr) }
+
+  /**
+   * Aggregate function: returns the value associated with the maximum value 
of ord.
+   *
+   * @group agg_funcs
+   * @since 3.3.0
+   */
+  def max_by(columnName: String, ordColumnName: String): Column =

Review comment:
       We will have too add them into PySpark and SparkR side too ... can be 
done separately though. cc @yoda-mon FYI




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to