title: Group by to club multiple column value in hive to one column
body: <p>I am trying to club multiple column value to one column based on group by key. Basically I will use this to create nested JSON using spark 1.6 dataframe api.</p>
  
  <p>Sample Input Table abc:- </p>
  
  <pre><code>a     b     c       d       e       f       g
  ---------------------------------------------
  aa    bb    cc      dd      ee      ff      gg
  aa    bb    cc1     dd1     ee1     ff1     gg1
  aa    bb    cc2     dd2     ee2     ff2     gg2
  aa1   bb1   cc3     dd3     ee3     ff3     gg3
  aa1   bb1   cc4     dd4     ee4     ff4     gg4
  </code></pre>
  
  <p>final output group by a,b :- </p>
  
  <pre><code>aa      bb      {{cc,dd,ee,ff,gg},{cc1,dd1,ee1,ff1,gg1},{cc2,dd2,ee2,ff2,gg2}}
  aa1     bb1     {{cc3,dd3,ee3,ff3,gg3},{cc4,dd4,ee4,ff4,gg4}}
  </code></pre>
  
  <p>I tried using collect_list but it can only group one column. Don't know how to group multiple column together. I tried using concat string and then use collect on it but I will loose schema mapping as I have to finally dump it in json format. Clubbing the colunms in form of map or struct will also work. Please suggest some elegant approach/solution to this problem. Thanks
  Note : Using Spark 1.6 </p>