title: Hdfs file access in spark
body: <p>I am developing an application , where I read a file from hadoop, process and store the data back to hadoop. 
  I am confused what should be the proper hdfs file path format. When reading a hdfs file from spark shell like</p>
  
  <pre><code>val file=sc.textFile("hdfs:///datastore/events.txt")
  </code></pre>
  
  <p>it works fine and I am able to read it.</p>
  
  <p>But when I sumbit the jar to yarn which contains same set of code it is giving the error saying</p>
  
  <pre><code>org.apache.hadoop.HadoopIllegalArgumentException: Uri without authority: hdfs:/datastore/events.txt
  </code></pre>
  
  <p>When I add name node ip as <code>hdfs://namenodeserver/datastore/events.txt</code> everything works.</p>
  
  <p>I am bit confused about the behaviour and need an guidance.</p>
  
  <p><strong>Note: I am using aws emr set up and all the configurations are default.</strong></p>