On Sat, Mar 17, 2012 at 1:06 AM, yonghu <yongyong...@gmail.com> wrote: > Hello, > > I have used the command ./hbase > org.apache.hadoop.hbase.mapreduce.Export 'test' > http://localhost:8020/test to export the data content from the test > table. And I can see the exported content from my hdfs folder, > hdfs://localhost/test/part-m-00000. I have tried 2 commands to read > the content in the part-m-00000. One is -cat, the other is -text. But > both of them show me some garbled message. Can anyone tell me that how > to rightly read the content from the exported file? >
The export produces hadoop sequencefiles where the key is a the row is a serialized instance of ImmutableBytesWritable and the value a serialized instance of the hbase Result object. See http://hbase.apache.org/xref/org/apache/hadoop/hbase/mapreduce/Export.html#99 where the mapreduce job is set up. To read the content, you need one of these: http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/SequenceFile.Reader.html Study the SequenceFileInputFormat for sample code. St.Ack