title: Spark path on Windows/Java: Why does a directory path work but a specific file fail?
body: <p>I am attempting to follow "Creating Dataframes" example found here: <a href="https://spark.apache.org/docs/2.2.0/sql-programming-guide.html#overview" rel="nofollow noreferrer">https://spark.apache.org/docs/2.2.0/sql-programming-guide.html#overview</a></p>
  
  <p>I am doing this in Java 8 on Windows and the following line of code:</p>
  
  <pre><code>Dataset&lt;Row&gt; df = spark.read().json("c:/sparkExamples/");
  </code></pre>
  
  <p>works while:</p>
  
  <pre><code>Dataset&lt;Row&gt; df = spark.read().json("c:/sparkExamples/people.json");
  </code></pre>
  
  <p>Fails with this exception:</p>
  
  <p>Exception in thread "main" org.apache.spark.sql.AnalysisException: Path does not exist: file:/c:/sparkExamples/people.json;</p>
  
  <p>From the example, it appears that specifying a file should work.</p>