2
votes

I am writing to ask for how to insert dynamic columns to HBase thru Pig Latin. The case is that my pig script will generate the following relation: (key, date, value) (key, date, value) (key, date, value)

And I wanna save them to my HBase. Obviously, key is the row key, but I wanna date could be a column defined in my columnFamily.

I know that HBaseStorage can be used to save data, like below. But the issue is that I cannot specify ** because it's designed to be dynamic. How can I deal with this scenario? Thanks in advance!

STORE relation INTO 'hbase://user' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('cf:{**}');

1

1 Answers

1
votes

As far as I know there's no built in pig functionality that will let you do that. However you can write a customized STORE user-defined-function to handle your case. You can even start with the HBaseStorage implementation as a baseline