Random function that produces a unique value upon each invocation unless a seed is provided.
If a seed is provided the returned value is identical across each invocation for a single row, but different across multiple rows.
The seed must be a constant.
Example:
0: jdbc:phoenix:localhost> select rand(), rand(), rand(1), rand(2), rand(1) from t;
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
| RAND() | RAND() | RAND(1) | RAND(2) | RAND(1) |
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
| 0.18927325291276054 | 0.19335253869230284 | 0.7308781907032909 | 0.7311469360199058 | 0.7308781907032909 |
| 0.08156917775368278 | 0.10178318739559034 | 0.41008081149220166 | 0.9014476240300544 | 0.41008081149220166 |
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
2 rows selected (0.096 seconds)
0: jdbc:phoenix:localhost> select rand(), rand(), rand(1), rand(2), rand(1) from t;
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
| RAND() | RAND() | RAND(1) | RAND(2) | RAND(1) |
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
| 0.6452639556507597 | 0.8167638693890659 | 0.7308781907032909 | 0.7311469360199058 | 0.7308781907032909 |
| 0.8084646053276106 | 0.6969504742211767 | 0.41008081149220166 | 0.9014476240300544 | 0.41008081149220166 |
+----------------------------+----------------------------+----------------------------+----------------------------+-----------------------+
2 rows selected (0.098 seconds)