Search code examples
tuplesapache-pigbigdatabagapache-datafu

Error when using LinkedIn's datafu package


I'm working on a project that uses the TransposeTupleToBag UDF of LinkedIn's datafu UDF compilation. Found here: https://github.com/linkedin/datafu/tree/master/src/java/datafu/pig/util. I execute the following commands in grunt shell:

REGISTER jar-file;

DEFINE Transpose datafu.pig.util.TransposeTupleToBag();

a = load data 'file' using PigStorage(',') as (schema);

b = foreach a generate select_columns_from_schema;

c = foreach b generate col1, col2, datafu.pig.util.Transpose(col3, col4...coln);

When I execute the last line, I get this error:

[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Instance name is null.  
This should not happen unless UDFContextSignature was not set.

What am I doing wrong? How to avoid it? I have not changed any of their code as well. And I'm only using TransposeTupleToBag, FieldNotFound and AliasableEvalFunc as they were the classes required to run Transpose successfully. I even tried the same with all classes loaded and it still gave me the same error. What's going on? Please help. Thanks!


Solution

  • TransposeTupleToBag requires a feature in Pig 0.11 where setUDFContextSignature is called. This is used to distinguish each invocation of the UDF. This method doesn't exist in Pig 0.10.