I have a sequential file which is the output of hadoop map-reduce job. In this file data is written in key value pairs ,and value itself is a map. I want to read the value a
Check the API documentation for SequenceFile#next(Writable, Writable)
while(reader.next(key,value))
{
System.out.println("Key is: "+textKey +" value is: "+val+"\n");
}
should be replaced with
while(reader.next(key,value))
{
System.out.println("Key is: "+key +" value is: "+value+"\n");
}
Use SequenceFile.Reader#getValueClassName to get the value type in the SequenceFile. SequenceFile have the key/value types in the file header.