Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to load data in hbase using Pig

Tags:

hadoop

I want load data through pig & process it into HBase. I have load text file on to HDFS. and then I have used below commands on pig.

A = LOAD '/tmp/hive-Vijay.Shinde/file.txt' USING PigStorage(',')
 as (strdata1:chararray, strdata2:int); 

then i used ,

STORE A INTO 'mydata' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('mycf:strdata2');

mydata is table in HBase.

It gives error: Unhandled internal error

like image 864
Vijay_Shinde Avatar asked Mar 03 '26 08:03

Vijay_Shinde


1 Answers

  1. Try to register the hbase jar in your pig file. for eg . register /home/hadoop/lib/hbase-0.92.0.jar
  2. Make sure that you created hbase table with column family before inserting the data.
  3. Also mention version of hadoop,pig and hbase.
  4. Also you can check your debug logs with web interface . if you are running cluster locally use localhost/jobtracker.jsp

    This will give you the more useful log information about job.

like image 184
mat_vee Avatar answered Mar 06 '26 04:03

mat_vee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!