title: Get sequential number of a row (rank) within a partition without using ROW_NUMBER() OVER function
body: <p>I need to rank rows by partition (or group), i.e. if my source table is:</p>
  <pre><code>NAME PRICE
  ---- -----
  AAA  1.59
  AAA  2.00
  AAA  0.75
  BBB  3.48
  BBB  2.19
  BBB  0.99
  BBB  2.50
  </code></pre>
  <p>I would like to get target table:</p>
  <pre><code>RANK NAME PRICE
  ---- ---- -----
  1    AAA  0.75
  2    AAA  1.59
  3    AAA  2.00
  1    BBB  0.99
  2    BBB  2.19
  3    BBB  2.50
  4    BBB  3.48
  </code></pre>
  <p>Normally I would use <code>ROW_NUMBER() OVER</code> function, so in Apache Hive it would be:</p>
  <pre><code>select
    row_number() over (partition by NAME order by PRICE) as RANK,
    NAME,
    PRICE
  from
    MY_TABLE
  ;
  </code></pre>
  <p>Unfortunately, Cloudera Impala does not support (at the moment) <code>ROW_NUMBER() OVER</code> function, so I'm looking for a workaround. Preferably not to use UDAF, as it will be politically difficult to convince to deploy it to the server.</p>