You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Anthony Alleven <aa...@iastate.edu> on 2014/03/12 04:36:19 UTC

Unable to add file paths when registering a UDF

Hello,

I am trying to use a User Defined Function and I am unable to get Pig
to recognize my compiled jar file when I have a path to the file. The
file works when I put the jar file into the working directory for Pig,
but I am a teaching assistant for a big-data course and we need
students to put their work in their respective directories.

Below is my pig script for my application:
REGISTER MovingAverage.jar;
--REGISTER /class/s14419x/lab7/MovingAverage.jar;

The first line works, but the second gives me:

ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: file
'/class/s14419x/lab7/MovingAverage.jar' does not exist.

I am teaching UDFs for a lab tomorrow so I would really appreciate any
help or insight you could offer.

Also, big fan of Pig. Keep it up!

Tony
-- 
Anthony Alleven
(952)-250-7166
Senior, Computer Engineering
IEEE | President
Microsoft Ambassador

Re: Unable to add file paths when registering a UDF

Posted by Andrew Musselman <an...@gmail.com>.
Or is it a network mount?

> On Mar 12, 2014, at 8:43 PM, Pradeep Gollakota <pr...@gmail.com> wrote:
> 
> According to the docs, It should work.
> http://pig.apache.org/docs/r0.12.0/basic.html#register
> 
> Stupid question, but is the path correct? Is it on HDFS or local disk?
> 
> 
> On Tue, Mar 11, 2014 at 8:36 PM, Anthony Alleven <aa...@iastate.edu>wrote:
> 
>> Hello,
>> 
>> I am trying to use a User Defined Function and I am unable to get Pig
>> to recognize my compiled jar file when I have a path to the file. The
>> file works when I put the jar file into the working directory for Pig,
>> but I am a teaching assistant for a big-data course and we need
>> students to put their work in their respective directories.
>> 
>> Below is my pig script for my application:
>> REGISTER MovingAverage.jar;
>> --REGISTER /class/s14419x/lab7/MovingAverage.jar;
>> 
>> The first line works, but the second gives me:
>> 
>> ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: file
>> '/class/s14419x/lab7/MovingAverage.jar' does not exist.
>> 
>> I am teaching UDFs for a lab tomorrow so I would really appreciate any
>> help or insight you could offer.
>> 
>> Also, big fan of Pig. Keep it up!
>> 
>> Tony
>> --
>> Anthony Alleven
>> (952)-250-7166
>> Senior, Computer Engineering
>> IEEE | President
>> Microsoft Ambassador
>> 

Re: Unable to add file paths when registering a UDF

Posted by Pradeep Gollakota <pr...@gmail.com>.
According to the docs, It should work.
http://pig.apache.org/docs/r0.12.0/basic.html#register

Stupid question, but is the path correct? Is it on HDFS or local disk?


On Tue, Mar 11, 2014 at 8:36 PM, Anthony Alleven <aa...@iastate.edu>wrote:

> Hello,
>
> I am trying to use a User Defined Function and I am unable to get Pig
> to recognize my compiled jar file when I have a path to the file. The
> file works when I put the jar file into the working directory for Pig,
> but I am a teaching assistant for a big-data course and we need
> students to put their work in their respective directories.
>
> Below is my pig script for my application:
> REGISTER MovingAverage.jar;
> --REGISTER /class/s14419x/lab7/MovingAverage.jar;
>
> The first line works, but the second gives me:
>
> ERROR org.apache.pig.tools.grunt.Grunt - ERROR 101: file
> '/class/s14419x/lab7/MovingAverage.jar' does not exist.
>
> I am teaching UDFs for a lab tomorrow so I would really appreciate any
> help or insight you could offer.
>
> Also, big fan of Pig. Keep it up!
>
> Tony
> --
> Anthony Alleven
> (952)-250-7166
> Senior, Computer Engineering
> IEEE | President
> Microsoft Ambassador
>