title: Write parquet to S3 using Spark Scala: java.lang.NullPointerException
body: <p>When I tried to write parquet to s3 with Scala using the code below:</p>
  
  <pre><code>ab.write.mode("overwrite").parquet(path)
  </code></pre>
  
  <p>And the error shows:</p>
  
  <blockquote>
    <p>org.apache.spark.SparkException: Job aborted. (Job aborted.) ......
    rg.apache.spark.SparkException: Job aborted due to stage failure: Task
    1 in stage 112.0 failed 1 times, most recent failure: Lost task 1.0 in
    stage 112.0 (TID 6273, localhost): java.lang.NullPointerException     at
    org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.confChanged(LocalDirAllocator.java:268)
      at
    org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.getLocalPathForWrite(LocalDirAllocator.java:344)
      at
    org.apache.hadoop.fs.LocalDirAllocator$AllocatorPerContext.createTmpFileForWrite(LocalDirAllocator.java:412)
      at
    org.apache.hadoop.fs.LocalDirAllocator.createTmpFileForWrite(LocalDirAllocator.java:198)
      at
    org.apache.hadoop.fs.s3a.S3AOutputStream.(S3AOutputStream.java:87)
      at
    org.apache.hadoop.fs.s3a.S3AFileSystem.create(S3AFileSystem.java:410)
      at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:905)  at
    org.apache.hadoop.fs.FileSystem.create(FileSystem.java:886)   at
    org.apache.hadoop.fs.FileSystem.create(FileSystem.java:783)</p>
  </blockquote>