1

I have a csv file which i am using as an input to the Pig Script. THe CSV has data like

1045 966 320189 1048 555 714067 1035 199 975050 1026 748 814808 1018 656 103141 1004 186 686093 1016 292 553100 1043 864 750624 1050 839 785765 1002 454 452221 1041 807 330616 1019 538 680915 1002 950 583977 1036 638 111509 1031 687 876615

My script---

REGISTER /home/user/myudfs.jar;
A = LOAS 'new.csv' using PigStorage(',');
STORE A INTO '/home/user/result.csv'
USING CSVExcelStorage(',', 'NO_MULTILINE', 'WINDOWS');

I have a myudfs jar having the builtin class CSVExcelStorage. I am registering it in my script.

While executing the script, I am getting an error

"ERROR 1070: Could not resolve myudfs.CSVExcelStorage using imports: [,org.apache.pig.builtin., org.apache.pig.impl.builtin.]"

Please help.

mdml
  • 22,442
  • 8
  • 58
  • 66
sravani malla
  • 47
  • 2
  • 7
  • 1
    You can try these solutions :- http://stackoverflow.com/questions/13696036/export-from-pig-to-csv & http://stackoverflow.com/questions/9910908/store-output-to-a-single-csv – Sharad Oct 28 '13 at 07:24

1 Answers1

0

If you have created the UDF class under a package, then in the PIG script you should give the fully qualified name of the UDF class, that is

STORE A INTO '/home/user/result.csv'
USING HereGoesThePackageName.CSVExcelStorage(',', 'NO_MULTILINE', 'WINDOWS');
mdml
  • 22,442
  • 8
  • 58
  • 66