title: How to segregate rows in Hive?
body: <p>I would like to achieve what <code>NTILE</code> does but not by passing the number of buckets but passing the number of items in each bucket. Is there a way to do this in Hive?</p>
  <p>So <code>NTILE(2)</code> will give you</p>
  <pre><code>StudentID       MARKS       NTILE  
        S5           93           1 
        S3           91           1 
        S2           83           1
        S4           83           2
        S1           75           2 
  </code></pre>
  <p>I want to achieve the same but not by passing the number of buckets(=2), but passing the number of items I need in each bucket(=3)</p>