Read all Parquet files saved in a folder via Spark : <p>I have a folder containing Parquet files. Something like this:</p>

<pre><code>scala&gt; val df = sc.parallelize(List(1,2,3,4)).toDF()
df: org.apache.spark.sql.DataFrame = [value: int]

scala&gt; df.write.parquet("/tmp/test/df/1.parquet")

scala&gt; val df = sc.parallelize(List(5,6,7,8)).toDF()
df: org.apache.spark.sql.DataFrame = [value: int]

scala&gt; df.write.parquet("/tmp/test/df/2.parquet")
</code></pre>

<p>After saving dataframes when I go to read all parquet files in <code>df</code> folder, it gives me error.</p>

<pre><code>scala&gt; val read = spark.read.parquet("/tmp/test/df")
org.apache.spark.sql.AnalysisException: Unable to infer schema for Parquet. It must be specified manually.;
  at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$8.apply(DataSource.scala:189)
  at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$8.apply(DataSource.scala:189)
  at scala.Option.getOrElse(Option.scala:121)
  at org.apache.spark.sql.execution.datasources.DataSource.org$apache$spark$sql$execution$datasources$DataSource$$getOrInferFileFormatSchema(DataSource.scala:188)
  at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:387)
  at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:152)
  at org.apache.spark.sql.DataFrameReader.parquet(DataFrameReader.scala:441)
  at org.apache.spark.sql.DataFrameReader.parquet(DataFrameReader.scala:425)
  ... 48 elided
</code></pre>

<p>I know I can read Parquet files by giving full path, but it would be better if there is a way to read all parquet files in a folder.</p>
