将 TSV 文件导入 hbase 表 [英] Import TSV file into hbase table

查看:28
本文介绍了将 TSV 文件导入 hbase 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 hbase 和 hive 的 hortonworks 2.1.我想从 tsv 文件创建一个 hbase 表.文件在这里:

I'm using hortonworks 2.1 with hbase and hive. I want to create a hbase table from tsv file. The file is here:

  id    c1  c2
row1    1   22
row2    e1  42
row3    g1  f2
row4    f1  c2
row5    d1  c2
row6    c1  42
row7    e1  c2
row8    c1  c2
row9    c1  c2
row10   c1  22

我使用的命令是:

bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns= HBASE_ROW_KEY,d:c1,d:c2 hbaseTable /tmp/testTSV.tsv

但是我收到了这个错误:

But I got this error:

SyntaxError: (hbase):5: syntax error, unexpected tSYMBEG

这是错误:

hbase(main):007:0> ImportTsv -Dimporttsv.columns= HBASE_ROW_KEY,d:c1,d:c2 hbaseTable/tmp/testTSV.tsv
SyntaxError: (hbase):7: syntax error, unexpected tSYMBEG

ImportTsv -Dimporttsv.columns= HBASE_ROW_KEY,d:c1,d:c2 hbaseTable /tmp/testTSV.tsv
                                              ^

推荐答案

您是否已经在 Hbase 中创建了表?您首先必须在 Hbase 中创建一个以d"作为列族的表,然后您可以将此 tsv 文件导入该表.

Do you have a table already created in Hbase ? You will first have to create a table in Hbase with 'd' as a column family and then you can import this tsv file into that table.

这篇关于将 TSV 文件导入 hbase 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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