You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "allisonwang-db (via GitHub)" <gi...@apache.org> on 2024/07/10 19:03:32 UTC

Re: [PR] [SPARK-48842][DOCS] Document non-determinism of max_by and min_by [spark]

allisonwang-db commented on code in PR #47266:
URL: https://github.com/apache/spark/pull/47266#discussion_r1672804446


##########
python/pyspark/sql/functions/builtin.py:
##########
@@ -1271,6 +1271,11 @@ def max_by(col: "ColumnOrName", ord: "ColumnOrName") -> Column:
     .. versionchanged:: 3.4.0
         Supports Spark Connect.
 
+    Notes
+    -----
+    The function is non-deterministic when the maximum value from `ord` is associated
+    with multiple values from `col`.

Review Comment:
   I think this is a bit hard to understand. Is there a simpler example we can use to demonstrate this idea?



-- 
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-unsubscribe@spark.apache.org

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


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