title: How to properly read a folder supposedly contains Parquet files from Spark if the folder is empty
body: <p>When I try to read a folder which supposedly contains files in Parquet format everything works if there is data, if there is no data I am getting error on the first line and subsequent code doesn't executue</p>
  
  <pre><code>val hdfsData: DataFrame = spark.sqlContext.read.parquet(hdfsPath)
  hdfsData.rdd.isEmpty() match ....
  ....
  </code></pre>
  
  <p>Error: org.apache.spark.sql.AnalysisException: Unable to infer schema for Parquet. It must be specified manually.;</p>
  
  <p>What's the right way to handle this scenario.</p>