title: HIVE: How to sum values from key/value strings by key
body: <p>I've got two <code>string</code> columns containing <code>key/value</code> pairs variables. Something like this:</p>
  
  <pre><code>    column1         column2
  a:1,b:2,c:3         a:5,c:3
     a:12,b:4     a:9,b:3,d:5
  </code></pre>
  
  <p>How can I sum those values (in real life I don't know how many keys I have, some keys can be found only in one column) by specific key to get this:</p>
  
  <pre><code>         column12
    a:6,b:2,c:6,d:0
   a:21,b:7,c:0,d:5
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code> a  b  c  d
   6  2  6  0
  21  7  0  5
  </code></pre>
  
  <p>Thank you for help!</p>