Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> How can I see the right format data content when I export the table content from Hbase?


Copy link to this message
-
Re: How can I see the right format data content when I export the table content from Hbase?
Thanks for your response.

Regards!

Yong

On Sat, Mar 17, 2012 at 10:09 PM, Stack <[EMAIL PROTECTED]> wrote:
> On Sat, Mar 17, 2012 at 1:06 AM, yonghu <[EMAIL PROTECTED]> 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