[SERVER-32928] $rand function Created: 26/Jan/18  Updated: 06/Dec/22  Resolved: 29/Jan/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Patrick Meredith Assignee: Backlog - Query Team (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-30405 add expression to generate a random n... Closed
Assigned Teams:
Query
Participants:

 Description   

Various dialects of SQL have a rand function. We need a pseudo-random function that takes a seed (or not) and produces a pseudo-random sequence.

{$rand: null}

or

{$rand: seed}

where seed is an integer. If null is passed, a random seed (up to the implementor) should be choses at the beginning of aggregation. If an integer seed is chosen, the same random sequence (per seed) should be used for each aggregation run, this allows for reproducibility.



 Comments   
Comment by Callum Gare [ 18/Nov/20 ]

I believe this is not actually the same and should be reopened. The ticket it has been marked as a duplicate of does not include the ability to seed random which is what I need.

Comment by David Storch [ 29/Jan/18 ]

Closing as a duplicate of SERVER-30405.

Generated at Thu Feb 08 04:31:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.