从HBase shell导出数据 [英] Export data from HBase shell

查看:622
本文介绍了从HBase shell导出数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将数据从HBase Shell导出到我可以解析的文本文件中,然后添加到msysql数据库中。



我正在使用以下命令:

  echoscan 'registration',{COLUMNS =>'registration:status'}| hbase shell> registration.txt 

将hbase shell中的所有内容导出到registration.txt中。



如何删除shell介绍和摘要,并将数据行追加到文本文件中:



  HBase Shell;输入'help< RETURN>'获取支持的命令列表。 
输入exit< RETURN>离开HBase Shell
版本0.94.5-mapr,Wed May 1 7:42:07 PDT 2013

总结我想省略:

 行列+小区
4419行,12.9840秒


解决方案

尝试此操作

  echoscan'registration',{COLUMNS =>'registration:status'}| hbase shell | grep^> registration.txt 

由于结果以单个空格为前缀,因此剩余的内容将被过滤掉。


Im trying to export data from HBase Shell to a text file which I can parse, and add to a msysql db.

I am currently using the following command:

echo "scan 'registration',{COLUMNS=>'registration:status'}" | hbase shell > registration.txt

which exports everything from the hbase shell to the registration.txt.

How can I remove the shell intro, and the summary and just append the rows of data to the text file:

Eg: Shell into I want to omit:

HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.5-mapr, Wed May  1 7:42:07 PDT 2013

Summary I want to omit:

ROW                                      COLUMN+CELL  
4419 row(s) in 12.9840 seconds

解决方案

Try this

echo "scan 'registration',{COLUMNS=>'registration:status'}" | hbase shell | grep "^ " > registration.txt

Since the results are prefixed with single space, remaining stuff would be filtered out.

这篇关于从HBase shell导出数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆