質問

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!

役に立ちましたか?

解決

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.

他のヒント

Turns out, LinkedIn's datafu is tested on pig 0.11.1 and nothing else. I was running pig 0.10 and so it wouldn't work as there was some property that probably is not being set in pig 0.10, but perhaps was fixed in pig 0.11.1.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top