Created on 11-30-2015 09:29 PM
One of the first cases we get to see with Hbase is loading it up with Data, most of the time we will have some sort of data in some format like CSV availalble and we would like to load it in Hbase, lets take a quick look on how does the procedure looks like:
lets examine our example data by looking at the simple structure that I have got for an industrial sensor
id, temp:in,temp:out,vibration,pressure:in,pressure:out 5842, 50, 30, 4, 240, 340
First of all make sure Hbase is started on your Sandbox as following
Creating the HBase Table
root> su - hbase
hbase> hbase shell
hbase(main):001:0> create 'sensor','temp','vibration','pressure'
hbase(main):001:0> list
Loading the Data
macbook-ned> scp hbase.csv root@sandbox.hortonworks.com:/home/hbase
hbase> hadoop dfs -copyFromLocal hbase.csv /tmp
hbase> hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, -Dimporttsv.columns="HBASE_ROW_KEY,id,temp:in,temp:out,vibration,pressure:in,pressure:out" sensor hdfs://sandbox.hortonworks.com:/tmp/hbase.csv
hbase(main):001:0> scan sensor
Remarks
Created on 06-16-2016 02:50 AM
Hi,
I am using Apache Hbase (Version 1.1.3)
I used the same importtsv syntax to import the same data (header removed) - got this error -
syntax error, unexpected ','
then removed the 'ID' column in '-Dimporttsv.columns'
hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator= ',' -Dimporttsv.columns="HBASE_ROW_KEY,temp:in,temp:out,vibration,pressure:in,pressure:out" sensor /user/hbase.csv
getting
syntax error, unexpected tIDENTIFIER
Please help
Thanks,
Sridharan
Created on 12-12-2016 07:29 PM
hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, -Dimporttsv.columns="HBASE_ROW_KEY,userId,prodId,rating,Date:M,Date:D,Date,Y,Help:a,Help:b,Review:a,Review:b" Producttest1 hdfs://localhost:50070:/mayur/ProductReview/InputFiles/ElectronicsShortTemp.csv SyntaxError: (hbase):19: syntax error, unexpected ','
hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, -Dimporttsv.columns="HBASE_ROW_KEY,userId,prodId,rating,Date:M,Date:D,Date,Y,Help:a,Help:b,Review:a,Review:b" Producttest1 hdfs://localhost:50070:/mayur/ProductReview/InputFiles/ElectronicsShortTemp.csv
Kindly help me for this. Thanks.Created on 02-16-2017 07:46 PM
@Ned Shawa I tried to follow the example above to import a csv file named drivers.
hbase(main):001:0> hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, –Dimporttsv.columns=”HBASE_ROW_KEY,driver_id,driver_name,certified,wage_plan” drivers /home/bilal/drivers.csv SyntaxError: (hbase):1: syntax error, unexpected ',' hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=, ^
I am getting the following SyntaxError unexpected ','.
Would you be kind enough to suggest the solution?
Thanking you in anticipation.
Created on 05-22-2017 04:38 PM
I am unable to load my data in HBase with this command, I get the following error
SyntaxError: (hbase):2: syntax error, unexpected tIDENTIFIER
Mine is a fully distributed cluster of Hadoop 2.7.3 and HBase 1.2.5. I have also tried removing the separator argument and loading a TSV file (the ',' given in the above line as the value of the argument separator gives an error anyway). It has probably got something to do with the way the tables are referenced in HBase 1.2.5. Please respond.
Created on 10-02-2019 08:54 AM
This is not an hbase shell command, we just need to run as a command from Unix (or Windows) shell
/usr/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator=',' -Dimporttsv.columns="HBASE_ROW_KEY,value" spark-defaults hdfs:///tmp/spark-defaults.prop