title: org.apache.spark.sql.AnalysisException: Path does not exist
body: <p>I was having issues trying to read a parquet file stored as a resource in my fat-jar so I tried following code which reads the resource file and copies it onto disk:</p>
  
  <pre><code>val inputFile = "test.parquet"
  val parquetFile = "/part-r-00000-2185f9a7-ea70-41be-95d2-e9f70f93c43b.parquet"
  FileUtils.copyInputStreamToFile(Main2.getClass.getResourceAsStream(parquetFile), new File(inputFile))
      LOGGER.info("saved resource to external file")
  </code></pre>
  
  <p>This code runs successfully. But when I try to read the file using:</p>
  
  <pre><code>spark.sqlContext.read.parquet(inputFile)
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>ERROR yarn.ApplicationMaster: User class threw exception: org.apache.spark.sql.AnalysisException: Path does not exist: hdfs://nameservice1/user/me/test.parquet
  </code></pre>
  
  <p>How can I fix this? I just want to be able to read a parquet file stored as resource in fat-jar. I have tried many things but none of them work.</p>