Here is the code in question
//read in the hadoop sequence file to sort
val file = sc.sequenceFile(input, classOf[Text], classOf[Text])
//this is the code we would like to avoid that maps the Hadoop Text Input to
Strings so the sortyByKey will run
file.map{ case (k,v) => (k.toString(), v.toString())}
//perform the sort on the converted data
val sortedOutput = file.sortByKey(true, 1)
//write out the results
sortedOutput.saveAsSequenceFile(output, Some(classOf[DefaultCodec]))
--
View this message in context:
http://apache-spark-user-list.1001560.n3.nabble.com/Sorting-a-Sequence-File-tp15633p15647.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]