Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-1301

RAND() should be RAND_UNIF(); also, we should create RAND_NORM() and add options

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • UDF
    • None

    Description

      The generation of pseudorandom data is very useful, but would be even MORE useful if we had a few levers to pull.

      Currently, RAND() generates a random number pulled from a uniform distribution between 0 and 1. It would be great if we could user-specify the min and max because that is a more elegant way to write code: RAND()*200+50 will generate the same thing as RAND_UNIF(min=50,max=250) but the latter is a much better way to express this in a readable manner.

      Similarly, it would be useful to have non-uniform random data for statistical purposes. RAND_NORM(mean=0,sd=1)

      Attachments

        Activity

          People

            pauly Paul Yang
            akramer Adam Kramer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: