Reading and Saving Sequence Files

Hi All,

i am trying to read a sequence file after saving it into HDFS but it is throwing the below error. Please help:

Command:

sc.sequenceFile("/user/cloudera/spark/departmentsSeq", classOf[IntWritable], classOf[Text]).map(rec => rec.toString()).collect().foreach(println)

Error:

:31: error: not found: type IntWritable
sc.sequenceFile("/user/cloudera/spark/departmentsSeq", classOf[IntWritable], classOf[Text]).map(rec => rec.toString()).collect().foreach(println)

Thanks

Hi, you might want to import the below.package.

import org.apache.hadoop.io._

2 Likes

@shaan0056, Thankyou. It worked. :+1: