Error when executing Pig Script

Posts: 8
Joined: Fri Dec 30, 2016 10:50 am

Error when executing Pig Script

Postby anantajb » Mon Jul 31, 2017 1:21 pm

I am trying to execute following script. Getting error (refer attached log file)

Code: Select all

data = LOAD '/user/anantajb/billing' USING PigStorage('\t') as (city: chararray,area: int,shop_number: chararray,sales: double);
sale_group = GROUP data by (city,area,shop_number);
grouped_sales = FOREACH sale_group GENERATE group,SUM(data.sales) as total_sales;
sale_summary = FOREACH grouped_sales GENERATE FLATTEN (group) as (city: chararray,area: int,shop_number: chararray),total_sales;
sale_grouped = GROUP sale_summary BY shop_number ;
top3 = foreach sale_grouped {
        sale_sorted = order sale_summary by total_sales DESC, ;
        top    = limit sale_sorted 3;
        generate top;

I tried to debug by refering to script to find top 3 URLs but could not succeed. Please help.

2017-07-31 18:49:40,551 [main] ERROR - ERROR 1200: <line 231, column 62> Syntax error, unexpected symbol at or near ';'
Details at logfile: /home/anantajb/pig_1501500269054.log
contains data and log file
(11.2 KiB) Downloaded 33 times


Return to “Big Data & Hadoop”



Global Association of Risk Professionals, Inc. (GARP®) does not endorse, promote, review or warrant the accuracy of the products or services offered by EduPristine for FRM® related information, nor does it endorse any pass rates claimed by the provider. Further, GARP® is not responsible for any fees or costs paid by the user to EduPristine nor is GARP® responsible for any fees or costs of any person or entity providing any services to EduPristine Study Program. FRM®, GARP® and Global Association of Risk Professionals®, are trademarks owned by the Global Association of Risk Professionals, Inc

CFA Institute does not endorse, promote, or warrant the accuracy or quality of the products or services offered by EduPristine. CFA Institute, CFA®, Claritas® and Chartered Financial Analyst® are trademarks owned by CFA Institute.

Utmost care has been taken to ensure that there is no copyright violation or infringement in any of our content. Still, in case you feel that there is any copyright violation of any kind please send a mail to and we will rectify it.