title: Read csv file from Hadoop using Spark
body: <p>I'm using spark-shell to read csv files from hdfs.
  I can read those csv file using the following code in bash:</p>
  
  <pre><code>bin/hadoop fs -cat /input/housing.csv |tail -5
  
  </code></pre>
  
  <p>so this suggest the housing.csv is indeed in hdfs right now.
  How can I read it using spark-shell?
  Thanks in advance.</p>
  
  <pre class="lang-scala prettyprint-override"><code>sc.textFile("hdfs://input/housing.csv").first()
  </code></pre>
  
  <p>I tried this way, but failed.</p>