HyukjinKwon commented on a change in pull request #34240:
URL: https://github.com/apache/spark/pull/34240#discussion_r726168788
##########
File path: python/pyspark/sql/functions.py
##########
@@ -199,6 +199,76 @@ def min(col: "ColumnOrName") -> Column:
return _invoke_function_over_column("min", col)
+@since(3.3)
+def max_by(col: "ColumnOrName", ord: "ColumnOrName") -> Column:
+ """
+ Returns the value associated with the maximum value of ord.
+
+ .. versionadded:: 3.3.0
+
+ Parameters
+ ----------
+ col : :class:`~pyspark.sql.Column` or str
+ target column that the value will be returned
+ ord : :class:`~pyspark.sql.Column` or str
+ column to be maximized
+
+ Returns
+ -------
+ :class:`~pyspark.sql.Column`
+ value associated with the maximum value of ord.
+
+ Examples
+ --------
+ >>> from pyspark.sql.functions import max_by
+ >>> spark.createDataFrame([
+ ... ("Java", 2012, 20000), \\
Review comment:
Actually you can remove \\\\ here
--
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]