Finally figured it out.
Flatten did the trick. Had to call flatten on the tuple returned by the
UDF as shown below.
B = FOREACH A GENERATE FLATTEN(PackageName.MyMethod());
Hope someone out there can make use of this behavior.
From: Sharma, Akash
Sent: Tuesday, May 03, 2011 2:52 PM
Subject: Question about Pig UDF and sqoop export
New to Pig UDF so requesting help to resolve the issue
Created a Pig UDF to transform an input tuple and generate an
Executed a Store to save the transformed tuple into a file
B = FOREACH A GENERATE PackageName.MyMethod();
STORE B into 'output' USING PigStorage();
My question is that when sqoop export reads this data from output HDFS
file and inserts into MYSQL table, the curly braces "(" and ")" are also
saved into the first and the last column of mysql table. Is there a way
to avoid curly braces for getting into MySQL column as part of first and
I tried to delimit to tabs explicitly in PigStorage() but that did not
resolve the issue.
Any help is appreciated.