Import TSV file into hbase table

前端 未结 3 1220
北恋
北恋 2021-01-14 08:23

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
         


        
3条回答
  •  一个人的身影
    2021-01-14 08:49

    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
      

提交回复
热议问题