Import TSV file into hbase table

回眸只為那壹抹淺笑 提交于 2019-12-01 09:04:30

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.

Mani

After creating the table, the import command dont execute in hbase shell, you can execute in normal console then it will work properly let us below example

  1. create the tabls in hbase shell as per our requirement

    create 'mytable5', 'cf'
    create 'mytable6', 'cf'
    
  2. keep the data in hdfs

    hadoop fs -put /home/mani/work/hbase_inputs /hbase_inputs
    
  3. import command execute in normal console

    hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.columns=HBASE_ROW_KEY,cf:c1,cf:c2 mytable5 hdfs://localhost:8020/hbase_inputs/import/sample1.tsv
    

You shoud create a table in Hbase with 'd' as a column family and then you can import this tsv file into that table.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!