Chhaya Vishwakarma
Chhaya Vishwakarma

Reputation: 1437

Bulk load in hbase using pig

I have a log file in HDFS which needs to be parsed and put in a Hbase table.

I want to do this using PIG .

How can i go about it.Pig script should parse the logs and then put in Hbase?

Upvotes: 1

Views: 797

Answers (1)

Jasper
Jasper

Reputation: 8705

The pig script would be (assuming tab is your data separator in log file):

A= load '/home/log.txt' using PigStorage('\t') as (one:chararray,two:chararray,three:chararray,four:chararray);

STORE A INTO 'hbase://table1' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('P:one,P:two,S:three,S:four');

Upvotes: 0

Related Questions