title: Reading from HDFS into Spark
body: <p>I am attempting to read a file from HDFS into Spark and perform some data processing on it. Originally, I used Sqoop to transfer the file from a MySQL database into Spark. The SQL database table has three columns - movieid, title, and genres. I was wondering how I should format sc.textFile to properly pull the file.</p>
  
  <p>Running hdfs dfs -ls, I see:</p>
  
  <pre><code>drwxr-xr-x  - hduser1 supergroup           0 2017-03-20 23:51 movies
  </code></pre>
  
  <p>Running hdfs dfs -ls movies, I see:</p>
  
  <pre><code>-rw-r--r--  1 hduser1 supergroup           0 2017-03-20 23:51 movies/_SUCCESS
  -rw-r--r--  1 hduser1 supergroup     1290474 2017-03-20 23:51 movies/part-m-0000
  </code></pre>
  
  <p>What I am trying to figure out is what would go in the below function:</p>
  
  <pre><code>case class Movie(movieid: String, title: String, genres: String)
  val movieRdd: RDD[Movie] = sc.textFile(***WHAT GOES HERE***).map(-formatting-)
  </code></pre>