PIG-HBASE - not able to store table to hbase from hdfs using PIG

Hi ,

I am not able to write a store a table in HBASE from a file in HDFS using PIG.

ratings1 = LOAD ‘/user/amold72427519/ml-100k/u.data’
USING PigStorage(’\t’)
AS (userID:int,movieID:int,rating:int,time:int);

STORE ratings1 INTO ‘hbase://userdata1’
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage (
‘info:movieID,info:rating,info:time’);

Getting the below error when I execute the above commands. Can someone help on this.

Pig Stack Trace

ERROR 2998: Unhandled internal error. org/apache/hadoop/hbase/mapreduce/TableInputFormat

java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/mapreduce/TableInputFormat
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)

@Amol_D,

Can you try below, for me its worked:

STORE rawD INTO ‘hbase://studentsravi’ USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(‘student_data:StudentName, student_data:Sector, student_data:DOB, student_data:qualification, student_data:score, student_data:state, student_data:randomName’);

2 Likes

Hi @raviteja, @abhinav,

It’s still not working for me… I am getting the same error as above.

STORE movieData INTO ‘hbase://Movie’ USING
org.apache.pig.backend.hadoop.hbase.HBaseStorage(‘movieID:Int, movieTitle:chararray, releaseDate:chararray,
videoRelease:chararray, imdbLink:chararray’);
/(‘MoviesData:movieID, MoviesData:movieTitle, MoviesData:releaseDate,
MoviesData:videoRelease, MoviesData:imdbLink’);
/

I have tried using below 2 formats while executing the query

(‘movieID:Int, movieTitle:chararray, releaseDate:chararray, videoRelease:chararray, imdbLink:chararray’);

(‘MoviesData:movieID, MoviesData:movieTitle, MoviesData:releaseDate,
MoviesData:videoRelease, MoviesData:imdbLink’);

2 tables created in HBASE
Movie and Movies

Movie contains 4 column and Movies contains only 1 MoviesData

Amol