title: Aggregate Sliding Window for hive
body: <p>I have a hive table which is in sorted order based on a numeric value say count.</p>
  <pre><code>fruit   count
  ------  -------
  apple   10
  orange  8
  banana  5
  melon   3
  pears   1
  </code></pre>
  <p>The total count is 27. I need it divided into three segments. So first 1/3 of count i.e. 1 to 9 is one, 10 to 18 is second and 19 to 27 is third.
  I guess I need to do some sought of sliding window.</p>
  <pre><code>fruit   count    zone
  ------  ------- --------
  apple   10      one
  orange  8       two
  banana  5       three
  melon   3       three
  pears   1       three
  </code></pre>
  <p>Any idea how to approach this</p>