-
- Downloads
[SPARK-13380][SQL][DOCUMENT] Document Rand(seed) and Randn(seed) Return...
[SPARK-13380][SQL][DOCUMENT] Document Rand(seed) and Randn(seed) Return Indeterministic Results When Data Partitions are not fixed. `rand` and `randn` functions with a `seed` argument are commonly used. Based on the common sense, the results of `rand` and `randn` should be deterministic if the `seed` parameter value is provided. For example, in MS SQL Server, it also has a function `rand`. Regarding the parameter `seed`, the description is like: ```Seed is an integer expression (tinyint, smallint, or int) that gives the seed value. If seed is not specified, the SQL Server Database Engine assigns a seed value at random. For a specified seed value, the result returned is always the same.``` Update: the current implementation is unable to generate deterministic results when the partitions are not fixed. This PR documents this issue in the function descriptions. jkbradley hit an issue and provided an example in the following JIRA: https://issues.apache.org/jira/browse/SPARK-13333 Author: gatorsmile <gatorsmile@gmail.com> Closes #11232 from gatorsmile/randSeed.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/randomExpressions.scala 1 addition, 1 deletion...he/spark/sql/catalyst/expressions/randomExpressions.scala
- sql/core/src/main/scala/org/apache/spark/sql/functions.scala 4 additions, 0 deletionssql/core/src/main/scala/org/apache/spark/sql/functions.scala
Loading
Please register or sign in to comment