0
votes

I am trying to load csv file into an hbase table using shell command Dimporttsv. The csv files reside in a dir in my hdfs (/csvFiles)

the csv file was generated from a mysql table with the following feilds:

+-------------+
Field       
+-------------+
tweet_id
user_id
screen_name
description
created_at
+-------------+

I created a table in hbase with a single family name as shown below:

create 'dummyTable', 'cf1'

the command I am using:

ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns=HBASE_ROW_KEY,cf1:user_id,cf1:tweet_id,cf1:screen_name,cf1:description,cf1:created_at dummyTable /csvFiles/all_users.csv

however I am getting this syntax error:

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

I've looked at the following posts and followed the recommendations in them but to no avail. I would appreciate your help.

Import TSV file into hbase table

https://community.hortonworks.com/articles/4942/import-csv-data-into-hbase-using-importtsv.html

http://hbase.apache.org/book.html#importtsv

1

1 Answers

0
votes

Exit from Hbase shell and try by adding single quotes to importtsv.columns

bash$ hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns='HBASE_ROW_KEY,cf1:user_id,cf1:tweet_id,cf1:screen_name,cf1:description,cf1:created_at' dummyTable hdfs://<your_name_node_addr>/csvFiles/all_users.csv

(or)

From Hbase Shell:

hbase(main):001:0> ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns='HBASE_ROW_KEY,cf1:user_id,cf1:tweet_id,cf1:screen_name,cf1:description,cf1:created_at' dummyTable hdfs://<your_name_node_addr>/csvFiles/all_users.csv