title: How to split single row in to multiple rows in Java Spark
body: <p>I have a Spark data frame that looks like this:</p>
  
  <pre><code>id  var_a var_b
  --  ----- -----
  01  1     2
  02  3     0
  </code></pre>
  
  <p>and I want to split values into multiple rows like this</p>
  
  <pre><code>id  var_name var_value
  --  -------- ---------
  01  var_a    1  
  01  var_b    2
  02  var_a    3
  02  var_b    0  
  </code></pre>
  
  <p>what's the best way to do it with Java Spark 1.6 API?</p>