title: Hive aggregation function that produces a map
body: <p>I have the following hive table</p>
  
  <p>ID, class,value</p>
  
  <p>1, A, 0.3</p>
  
  <p>1, B, 0.4</p>
  
  <p>1, C, 0.5</p>
  
  <p>2, B, 0.1</p>
  
  <p>2, C, 0.2</p>
  
  <p>I want to get </p>
  
  <p><code>ID, class:value</code></p>
  
  <p><code>1, [A:0.3, B:0.4, C:0.5]</code></p>
  
  <p><code>2, [B:0.1, C:0.2]</code></p>
  
  <hr>
  
  <p>I know that there is a <code>collect_set()</code> UDAF that produces a list of class or list of value, is there anyway to get a list of key:value pairs?</p>
  
  <p>NOTE:
  I guess I can use two <code>collect_set()</code> one for class column and one for value column but I am not sure if the lists will be in the same order.</p>