title: How do we rank dataframe?
body: <p>I have sample dataframe as below :</p>
  
  <p><strong>i/p</strong></p>
  
  <pre><code>accountNumber   assetValue  
  A100            1000         
  A100            500          
  B100            600          
  B100            200          
  </code></pre>
  
  <p><strong>o/p</strong></p>
  
  <pre><code>AccountNumber   assetValue  Rank
  A100            1000         1
  A100            500          2
  B100            600          1
  B100            200          2
  </code></pre>
  
  <p>Now my question is how do we add this rank column on dataframe which is sorted by account number. I am not expecting huge volume of rows so open to idea if I need to do it outside of dataframe.</p>
  
  <p>I am using Spark version 1.5 and SQLContext hence cannot use Windows function</p>