How to read hadoop sequential file? How to read hadoop sequential file? hadoop hadoop

How to read hadoop sequential file?


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.