You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Nathan Hoult <nh...@gmail.com> on 2010/05/23 00:32:16 UTC

Get field names in StoreFunc impl

I am wanting to make a writer that will, using the field names, look into an
HBase table and compare fields using field names:

example:

-------------
REGISTER ./myUDF.jar;

raw = LOAD 'My_File' USING PigStorage('|') AS (key, field1, field2, field3,
field4);

STORE raw INTO 'My_File-results' USING com.pig.store.HBaseDiff('Mart_Name');
-------------

so I found some reference to checkSchema() but I am unable to figure out
what to do with ResourceSchema. I have tried:
- getFields() and for each get name but got nothing
- fieldNames() but that is empty
- setting the fields I want via setFields() but nothing changed

maybe I am way off base, I was hoping more for a Tuple getFieldNames()
function that gave me a String list in the same order as the Tuple.

I have searched for 4 hours and am unable to find anything on how I would do
it, sorry if it is obvious and I didn't find it.

Thanks,
- Nathan