Support Questions

Find answers, ask questions, and share your expertise

I am preparing for HDPCD,. While practising Pig scripts, when I try the DUMP statement after the FILTER statement I get "ERROR 1003: Unable to find an operator for alias", Does anyone else face the similar issue (It's a non Java scripting).

avatar
Explorer
 
1 ACCEPTED SOLUTION

avatar

@Rashmi Gupta

There is a spelling mistake in your alias.

grunt> moive_rate = FILTER movie_a BY year==1994;
grunt> dump movie_rate;

When you assign you give that as moive_rate (Here the spelling is wrong for movie) whereas when you dump you give it as movie_rate.

Please try after correcting the spelling.

View solution in original post

8 REPLIES 8

avatar

I might be related to :

http://stackoverflow.com/questions/37685723/1003-error-unable-to-find-an-operator-for-alias-in-group...

If this does not help, can you post the commands you are trying and the stack trace to debug.

avatar
Explorer

Hi @Namit Maheshwari

Thanks for your response. I have placed the screenshots in the attached file, please have a look. It's a very simple FILTER command on a set of just 10 records.

pig-error1-hortonworks.png

Thanks,

Rashmi

avatar

Rashmi your screenshot is not very readable.

Can you type the script you are trying to run below?

avatar
Explorer

Hi Namit,

Data is ;

(1,NightmareBeforeChristmas,1993,3.9,4568)

(2,TheMummy,1932,3.5,4388)

(3,OrphansoftheStorm,1921,3.2,9062)

(4,TheObjectofBeauty,1991,2.8,6150)

(5,NightTide,1963,2.8,5126)

(6,OneMagicChristmas,1985,3.8,5333)

(7,MurielsWedding,1994,3.5,6323)

(8,MothersBoys,1994,3.4,5733)

(9,NosferatuOriginalVersion,1929,3.5,5651)

(10,NickofTime,1995,3.4,5333)

Code is;

movie_a = LOAD '/root/horton/movie_rev.txt' USING PigStorage(',') as (id:int ,name:chararray ,year:int ,rating:float ,duration:int);

grunt> moive_rate = FILTER movie_a BY year==1994;

grunt> dump movie_rate;

Error is;

2017-04-29 07:57:48,709 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1003: Unable to find an operator for alias movie_rate

avatar
Explorer

Thanks a lot Namit. I didn't realised I am doing such a silly mistake. it's working now. thanks again.

avatar

@Rashmi Gupta

There is a spelling mistake in your alias.

grunt> moive_rate = FILTER movie_a BY year==1994;
grunt> dump movie_rate;

When you assign you give that as moive_rate (Here the spelling is wrong for movie) whereas when you dump you give it as movie_rate.

Please try after correcting the spelling.

avatar

Hi Rashmi, Can you please accept my answer, if it helped you to resolve the issue.

avatar
Explorer

Hi Namit, Ahh, thanks a lot.. such a silly mistake... it's working now. Thanks again.

Rashmi