title: How to return selectively multiple rows from one rows in Scala
body: <p>There is a DataFrame, "rawDF" and its columns are </p>
  
  <pre><code>time     |id1|id2|...|avg_value|max_value|min_value|std_value|range_value|..
  10/1/2015|1  |3  |...|0.0      |0.2      |null     |null     |null     | ...
  10/2/2015|2  |3  |...|null     |null     |0.3      |0.4      |null     | ...
  10/3/2015|3  |5  |...|null      |null     |null     |0.4      |0.5      | ...
  </code></pre>
  
  <p>For each row, I'd like to return multiple rows based on this five "values" (avg, min, max, std, range). But, if the value is null, I'd like to skip. </p>
  
  <p>So, so output should be </p>
  
  <pre><code>10/1/2015|1  |3  |...|0.0 
  10/1/2015|1  |3  |...|0.2 
  10/2/2015|2  |3  |...|0.3
  10/2/2015|2  |3  |...|0.4
  10/3/2015|3  |5  |...|0.4
  10/3/2015|3  |5  |...|0.5
  </code></pre>
  
  <p>I'm not much familiar with Scala, so, I'm struggling with this. </p>
  
  <pre><code>val procRDD = rawDF.flatMap( x =&gt; for(valInd &lt;-10 to 14) yield {
   if(x.get(valInd) != null) { ...)) }
      } )
  </code></pre>
  
  <p>This code includes  <code>null</code> return. 
  So, can you give me some idea? </p>