title: add a new column for unique ID in hive table
body: <p>i have a table in <strong>hive</strong> with two columns: <strong>session_id</strong> and <strong>duration_time</strong> like this:</p>
  
  <pre><code>|| session_id || duration||
  
      1               14          
      1               10      
      1               20          
      1               10          
      1               12          
      1               16          
      1               8       
      2               9           
      2               6           
      2               30          
      2               22
  </code></pre>
  
  <p>i want to add a new column with unique id when:</p>
  
  <p>the session_id is changing <strong>or</strong> the duration_time > 15</p>
  
  <p>i want the output to be like this:</p>
  
  <pre><code>session_id      duration    unique_id
  1               14          1
  1               10          1
  1               20          2
  1               10          2
  1               12          2
  1               16          3
  1               8           3
  2               9           4
  2               6           4
  2               30          5
  2               22          6
  </code></pre>
  
  <p>any ideas how to do that in <strong>hive QL</strong>?</p>
  
  <p>thanks!</p>