I am facing issue while calling a UDF in PIG. UDF is referring a CSV file. When I call that UDF in PIG, I am getting the below error .
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 2078: Caught error from UDF: pig_lib.FN_LOCMATCH [./CITY_DATA.csv (No such file or directory)]. CSV file is present in the path where jar is placed.
CSV file is placed in this path /home/proj/RESOURCE
I tried by hardcoding the CSV file path in Java class. But still I am getting the same below error.
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 2078: Caught error from UDF: pig_lib.FN_LOCMATCH [/home/proj/RESOURCE/CITY_DATA.csv (No such file or directory)]
Hi Harsh J,
Thanks for your immediate reply. I have used Java.io.file to open the file. I am able to use the funciton in Hive and its working fine.
I have given the below command before using the funciton in Hive.
add file hdfs:////home/proj/RESOURCE/CITY_DATA.csv;
create temporary function FN_LOCMATCH as ‘hive_lib. FN_LOCMATCH’;
User has the access for this path. Pls shed some light to resolve the issue.