title: Why does Spark application fail with "IOException: (null) entry in command string: null chmod 0644"?
body: <p>I'm trying to write the dataset results into a single CSV using below using JAVA </p>
  
  <pre><code>dataset.write().mode(SaveMode.Overwrite).option("header",true).csv("C:\\tmp\\csvs");
  </code></pre>
  
  <p>But it goes for timed out , the file is not being written. </p>
  
  <p>Throws <code>org.apache.spark.SparkException: Job aborted.</code></p>
  
  <p>Error:</p>
  
  <pre><code>org.apache.spark.SparkException: Job aborted due to stage failure:
  
  Task 0 in stage 13.0 failed 1 times, most recent failure: Lost task 0.0 in stage 13.0 (TID 16, localhost): java.io.IOException: (null) entry in command string: null chmod 0644 C:\tmp\12333333testSpark\_temporary\0\_temporary\attempt_201712282255_0013_m_000000_0\part-r-00000-229fd1b6-ffb9-4ba1-9dc9-89dfdbd0be43.csv
  at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:770)
  at org.apache.hadoop.util.Shell.execCommand(Shell.java:866)
  at org.apache.hadoop.util.Shell.execCommand(Shell.java:849)
  at org.apache.hadoop.fs.RawLocalFileSystem.setPermission(RawLocalFileSystem.java:733)
  at org.apache.hadoop.fs.RawLocalFileSystem$LocalFSFileOutputStream.&lt;init&gt;(RawLocalFileSystem.java:225)
  at org.apache.hadoop.fs.RawLocalFileSystem$LocalFSFileOutputStream.&lt;init&gt;(RawLocalFileSystem.java:209)
  at org.apache.hadoop.fs.RawLocalFileSystem.createOutputStreamWithMode(RawLocalFileSystem.java:307)
  at org.apache.hadoop.fs.RawLocalFileSystem.create(RawLocalFileSystem.java:296)
  at org.apache.hadoop.fs.RawLocalFileSystem.create(RawLocalFileSystem.java:328)
  at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer.&lt;init&gt;(ChecksumFileSystem.java:398)
  at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:461)
  at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:440)
  at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:911)
  at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:892)
  at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:789)
  at org.apache.hadoop.mapreduce.lib.output.TextOutputFormat.getRecordWriter(TextOutputFormat.java:132)
  at org.apache.spark.sql.execution.datasources.csv.CsvOutputWriter.&lt;init&gt;(CSVRelation.scala:200)
  at org.apache.spark.sql.execution.datasources.csv.CSVOutputWriterFactory.newInstance(CSVRelation.scala:170)
  at org.apache.spark.sql.execution.datasources.BaseWriterContainer.newOutputWriter(WriterContainer.scala:131)
  at org.apache.spark.sql.execution.datasources.DefaultWriterContainer.writeRows(WriterContainer.scala:247)
  at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1$$anonfun$apply$mcV$sp$1.apply(InsertIntoHadoopFsRelationCommand.scala:143)
  at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand$$anonfun$run$1$$anonfun$apply$mcV$sp$1.apply(InsertIntoHadoopFsRelationCommand.scala:143)
  at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
  at org.apache.spark.scheduler.Task.run(Task.scala:86)
  at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  </code></pre>