Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

UDF + local file

UDF + local file

Expert Contributor

Hi,

I created UDF that reads local file, which is passed into UDF as a parameter. Im running everything in local mode.

cd pig-test;
touch input_file;
pig -x local
xx = my.udf('input_file')

When i run pig in mapreduce mode,, who/how will copy that input_file to appropriate nodes?

Thank you!

5 REPLIES 5

Re: UDF + local file

@John Smith

You will be copying the file in hdfs and read the file from hdfs. Please see this tutorial

Re: UDF + local file

Mentor

@John Smith you will need to specify the full path to hdfs i.e. hdfs://namenode:8020/user/username as your hdfs path. For actual copy commands refer to the docs.

Re: UDF + local file

Mentor

@John Smith do you have enough information? Can you choose one of the answers to close out the thread?

Re: UDF + local file

New Contributor

You can check out following tutorials

Re: UDF + local file

New Contributor

<a href ="http://www.bisptrainings.com">Go through the tutorial</a>

Don't have an account?
Coming from Hortonworks? Activate your account here