title: Spark Scala - textFile() and sequenceFile() RDDs
body: <p>I'm successfully loading my sequence files into a DataFrame with some code like this:</p>
  
  <pre><code>val sc = new SparkContext(conf)
  val sqlContext = new org.apache.spark.sql.SQLContext(sc)
  sc.sequenceFile[LongWritable,String](src)
  val jsonRecs = file.map((record: (String, String)) =&gt; new String(record._2))
  val df = sqlContext.read.json(jsonRecs)
  </code></pre>
  
  <p>I'd like to do the same with some text files.  The text files have a similar format as the sequence files (A timestamp, a tab char, then the json).  But the problem is textFile() returns an RDD[String] instead of an RDD[LongWritable,String] like the sequenceFile() method.</p>
  
  <p>My goal is to be able to test the program with either sequence files or text files as input.  </p>
  
  <p>How could I convert the RDD[String] coming from textFile() into an RDD[LongWritable,String]?  Or is there a better solution?</p>