Export data from HBase shell

喜夏-厌秋 提交于 2019-12-05 06:53:32

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.

Tariq

You could add one more step to your pipeline to skip the first 4 lines which contain all the undesired stuff and achieve that :

$ echo "scan 'registration',{COLUMNS=>'registration:status'}" | hbase shell \
   |  awk 'NR>5{print$0}'

You can also simply things a bit by making use of a here string in a Bash shell for example:

$ hbase shell <<< "scan 'registration',{COLUMNS=>'registration:status'}" \
    | grep "^ " > registration.txt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!