title: Reset the rank in hive
body: <p>I want to partition the data as given below. But as given in the <a href="http://thehobt.blogspot.in/2009/02/rownumber-rank-and-denserank.html" rel="nofollow">link</a> there is no in built function which reset the Rank again staring from 1. I have tried <code>ROW_NUMBER(), RANK(), DENSE_RANK()</code>.  So, can anyone tell me how to achieve this? </p>
  
  <pre><code>  Col1     Col2    Rank
  cookie1    ABC      1
  cookie1    ABC      1
  cookie1    EFG      2
  cookie1    EFG      2
  cookie1    IJK      3
  cookie1    IJK      3
  
  cookie2    XYZ      1
  cookie2    XYZ      1
  cookie2    LMN      2
  </code></pre>