我怎样才能在文本文件中转储hbase表? [英] How can I dump hbase table in a text file?

查看:102
本文介绍了我怎样才能在文本文件中转储hbase表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在HBase中转储一张表并以文本文件/ csv格式需要它?我在HBase中寻找 scan export get 命令shell,但它不起作用。

I need to take a dump of one table in HBase and need it in a text file/csv format? I looked for scan, export and get commands in HBase shell, but it doesn't work.

推荐答案

有很多方法可以从HBase表中获取数据,如运行导出地图/缩小作业。你可以在这里阅读这篇 http://blog.sematext。 com / 2011/03/11 / hbase-backup-options /
如果你想控制哪些行/单元格被写入,你可以使用猪脚本

There are a lot of ways to get data out of an HBase table like running the export map/reduce job. You can read about this and other here http://blog.sematext.com/2011/03/11/hbase-backup-options/ If you want to control which rows/cells are written you can do that with pig scripts

x = LOAD 'hbase://<sourceDatabaseName>' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage( '<family:qualifier>', '<family:qualifier2>','-loadKey true') AS (ID: bytearray  , Value1:chararray , Value2:chararray);

STORE x INTO '<destFileName>'
USING CSVExcelStorage(['<delimiter>' [,{'YES_MULTILINE' | 'NO_MULTILINE'} [,{'UNIX' | 'WINDOWS' | 'UNCHANGED'}]]]);

这篇关于我怎样才能在文本文件中转储hbase表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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