Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-397

ORDER BY rand() does not work.

    XMLWordPrintableJSON

Details

    Description

      The cause of the issue below is that r is not materialized.

      select id, name, rand() r from countries order by r limit 10;
      Query: select id, name, rand() r from countries order by r limit 10
      Query finished, fetching results ...
      +----+----------------+-----------------------+
      | id | name           | r                     |
      +----+----------------+-----------------------+
      | 3  | Canada         | 0.0004714746030380365 |
      | 5  | Australia      | 0.5895895192351144    |
      | 1  | United States  | 0.4431900859080209    |
      | 4  | Ireland        | 0.0739258840093044    |
      | 6  | Netherlands    | 0.4621509646354946    |
      | 2  | United Kingdom | 0.6679162032287178    |
      | 9  | France         | 0.8352529978543767    |
      | 8  | Germany        | 0.1610932858479644    |
      | 7  | New Zealand    | 0.4815021690360746    |
      | 91 | Antigua        | 0.5511845208477156    |
      +----+----------------+-----------------------+
      Returned 10 row(s) in 0.48s
      

      Attachments

        Issue Links

          Activity

            People

              twmarshall Thomas Tauber-Marshall
              alex.behm Alexander Behm
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: