Hi,
I have a UDF that is:
public DataBag exec(Tuple input) throws IOException 

This bag has tuples with 2 String fields each.
How do I tell in Pig to expect a bag{tuple(chararray, chararray)} from the UDF 
call 

u = foreach g generate UrlCoOccurence($1) as pairs;



I tried this 
u = foreach g generate (bag{tuple(chararray, chararray)})UrlCoOccurence($1) as 
pairs;

this gives me:
2011-11-29 15:47:07,048 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
1052: Cannot cast bag with schema bag to bag with schema 
bag({(chararray,chararray)})


Basically my UDF returns a bag of tuples which have 2 values. I need to flatten 
it and v1 & v2.
 
-Ayon
See My Photos on Flickr
Also check out my Blog for answers to commonly asked questions.

Reply via email to