starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

function rand(seed) can not return fixed result.

Open wangsimo0 opened this issue 8 months ago • 0 comments

function rand(seed) cannot return fixed result.

StarRocks > select rand(1);
+---------------------+
| rand(1)             |
+---------------------+
| 0.18517100684872181 |
+---------------------+
1 row in set (0.00 sec)

StarRocks > select rand(1);
+--------------------+
| rand(1)            |
+--------------------+
| 0.2376706186515989 |
+--------------------+
1 row in set (0.00 sec)

StarRocks > select rand(1);
+--------------------+
| rand(1)            |
+--------------------+
| 0.9819687331930045 |
+--------------------+
1 row in set (0.00 sec)

StarRocks > select rand(5);
+--------------------+
| rand(5)            |
+--------------------+
| 0.6355943365382248 |
+--------------------+
1 row in set (0.00 sec)

StarRocks > select rand(5);
+---------------------+
| rand(5)             |
+---------------------+
| 0.18223149391184523 |
+---------------------+
1 row in set (0.00 sec)

StarRocks > select rand(1);
+--------------------+
| rand(1)            |
+--------------------+
| 0.2523335304643378 |
+--------------------+
1 row in set (0.00 sec)

wangsimo0 avatar Jun 12 '24 06:06 wangsimo0