You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2016/10/05 18:13:20 UTC

[jira] [Created] (CALCITE-1414) Add a RANDOM function

Julian Hyde created CALCITE-1414:
------------------------------------

             Summary: Add a RANDOM function
                 Key: CALCITE-1414
                 URL: https://issues.apache.org/jira/browse/CALCITE-1414
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde
            Assignee: Julian Hyde


Add a RANDOM function.
It is not standard SQL, but most DBMSs have one, and it be useful.

It will also allow us to better test non-deterministic expressions.

I propose that:
*  {{RANDOM(n)}} returns an integer between 0 and n - 1 inclusive.
* There is no facility to specify a seed at this time.
* The random number generator is randomly seeded at query start time based on (say) the method used by Java's {{new Random()}}; if you run the query twice, you will (probably) not get the same results.
* If you call the function twice in the same row, it will (probably) return different results.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)