title: Spark (Scala) execute dataframe within for loop
body: <p>I am using spark 1.6.1 version. I have requirement to execute dataframe in loop.</p>
  
  <pre><code>for ( i &lt;- List ('a','b')){
   val i = sqlContext.sql("SELECT i, col1, col2 FROM DF1")}
  </code></pre>
  
  <p>I want this dataframe to be executed twice (<code>i = a</code> and <code>i = b</code>).</p>