[MINOR][SQL] Modify the example of rand and randn
### What changes were proposed in this pull request? This PR fixes the examples of `rand` and `randn`. ### Why are the changes needed? SPARK-23643 (#20793) fixes an issue which is related to the seed and it causes the result of `rand` and `randn`. Now the results of `SELECT rand(0)` and `SELECT randn((null)` are `0.7604953758285915` and `1.6034991609278433` respectively, and they should be deterministic because the number of partitions are always 1 (the leaf node is `OneRowRelation`). ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Built the doc and confirmed it. ![rand-doc](https://user-images.githubusercontent.com/4736016/121359059-145a9b80-c96e-11eb-84c2-2f2b313614f3.png) Closes #32844 from sarutak/rand-example. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
This commit is contained in:
parent
e9d60156c4
commit
94b66f5e28
|
@ -78,9 +78,9 @@ trait ExpressionWithRandomSeed extends Expression {
|
|||
> SELECT _FUNC_();
|
||||
0.9629742951434543
|
||||
> SELECT _FUNC_(0);
|
||||
0.8446490682263027
|
||||
0.7604953758285915
|
||||
> SELECT _FUNC_(null);
|
||||
0.8446490682263027
|
||||
0.7604953758285915
|
||||
""",
|
||||
note = """
|
||||
The function is non-deterministic in general case.
|
||||
|
@ -131,9 +131,9 @@ object Rand {
|
|||
> SELECT _FUNC_();
|
||||
-0.3254147983080288
|
||||
> SELECT _FUNC_(0);
|
||||
1.1164209726833079
|
||||
1.6034991609278433
|
||||
> SELECT _FUNC_(null);
|
||||
1.1164209726833079
|
||||
1.6034991609278433
|
||||
""",
|
||||
note = """
|
||||
The function is non-deterministic in general case.
|
||||
|
|
Loading…
Reference in a new issue