title: How can I read multiple parquet files in spark scala
body: <h3>Below are some folders, which might keep updating with time. They have multiple .parquet files. How can I read them in a Spark dataframe in scala ?</h3>
  <ul>
  <li>&quot;id=200393/date=2019-03-25&quot;</li>
  <li>&quot;id=200393/date=2019-03-26&quot;</li>
  <li>&quot;id=200393/date=2019-03-27&quot;</li>
  <li>&quot;id=200393/date=2019-03-28&quot;</li>
  <li>&quot;id=200393/date=2019-03-29&quot; and so on ...</li>
  </ul>
  <p>Note:- There could be 100 date folders, I need to pick only specific(let's say for 25,26 and 28)</p>
  <p>Is there any better way than below ?</p>
  <pre><code>import org.apache.spark._
  import org.apache.spark.SparkContext._
  import org.apache.spark.sql._
  
  val spark = SparkSession.builder.appName(&quot;ScalaCodeTest&quot;).master(&quot;yarn&quot;).getOrCreate()
  val parquetFiles = List(&quot;id=200393/date=2019-03-25&quot;, &quot;id=200393/date=2019-03-26&quot;, &quot;id=200393/date=2019-03-28&quot;)
  
  spark.read.format(&quot;parquet&quot;).load(parquetFiles: _*)
  </code></pre>
  <p>The above code is working but I want to do something like below-</p>
  <pre><code>val parquetFiles = List()
  parquetFiles(0) = &quot;id=200393/date=2019-03-25&quot;
  parquetFiles(1) = &quot;id=200393/date=2019-03-26&quot;
  parquetFiles(2) = &quot;id=200393/date=2019-03-28&quot;
  spark.read.format(&quot;parquet&quot;).load(parquetFiles: _*)
  </code></pre>