title: Apache Spark: resulting file being created at worker node instead of master node
body: <p>I configure one master at local pc and a worker node inside virtualbox and the result file has been creating at worker node, instread of sending back to master node, I wonder why is that.</p>
  
  <p>Because my worker node cannot send result back to master node? how to verify that? </p>
  
  <p>I use spark2.2. 
  I use same <strong>username</strong> for master and worker node.
  I also configured ssh without password.<br>
  I tried <strong>--deploy-mode client</strong> and <strong>--deploy-mode cluster</strong><br>
  I tried once then I switched the master/worker node and I got the same result.</p>
  
  <pre><code>val result = joined.distinct()
  result.write.mode("overwrite").format("csv")
        .option("header", "true").option("delimiter", ";")
        .save("file:///home/data/KPI/KpiDensite.csv")
  </code></pre>
  
  <p>also, for input file, I load like this:</p>
  
  <pre><code>val commerce = spark.read.format("com.databricks.spark.csv").option("header", "true").option("inferSchema", "true")
    .option("delimiter", "|").load("file:///home/data/equip-serv-commerce-infra-2016.csv").distinct()
  </code></pre>
  
  <p>but why must I presend the file both at master and worker node at the same position? I don't use yarn or mesos right now.</p>