txt文件导入HBase
2017-03-02 15:43
141 查看
create 'aipai', {NAME=>'info'}: 创建表
describe 'aipai' :查看表结构
scan 'aipai' ,{LIMIT=>20} :查看表前二十条数据
count 'aipai', {INTERVAL => 1000, CACHE => 500} :统计表数据
hadoop fs –put /tmp/hbasedata/1-20W.txt /hbasedata/1.txt :把txt文件放到hdfs /hbasedata目录上
bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns=info:username,HBASE_ROW_KEY,info:email -Dimporttsv.separator=, aipai /hbasedata/1.txt
进入hbase目录:执行该命令,每行记录以逗号分隔。
XXX,XXXX,XXXX
aipai:表名
describe 'aipai' :查看表结构
scan 'aipai' ,{LIMIT=>20} :查看表前二十条数据
count 'aipai', {INTERVAL => 1000, CACHE => 500} :统计表数据
hadoop fs –put /tmp/hbasedata/1-20W.txt /hbasedata/1.txt :把txt文件放到hdfs /hbasedata目录上
bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns=info:username,HBASE_ROW_KEY,info:email -Dimporttsv.separator=, aipai /hbasedata/1.txt
进入hbase目录:执行该命令,每行记录以逗号分隔。
XXX,XXXX,XXXX
aipai:表名
相关文章推荐