Sunday, September 15, 2013

Pig throws error for simple Group by and count occurrence task

Pig throws error for simple Group by and count occurrence task

Using Hadoop's PIG-Latin to find the number of occurrences of unique
search strings from a search engine log file.(click here to view the
sample log file)
Pig script
excitelog = load '/user/hadoop/input/excite-small.log' using PigStorage() AS
(encryptcode:chararray, numericid:int, searchstring:chararray);
GroupBySearchString = GROUP excitelog by searchstring;
searchStrFrq = foreach GroupBySearchString Generate group as
searchstring,count(searchstring);
Error encountered
[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not
resolve count using imports: [, org.apache.pig.builtin.,
org.apache.pig.impl.builtin.]

No comments:

Post a Comment