Pig Script Fails!



0
My pig script fails. I couldn't find out why? Can someone please help?
Nasdaq= Load 'Pig_datasets/NASDAQ_daily_prices_A_sample.csv' AS (exchange: chararray,stock_symbol: chararray,
date: chararray,stock_price_open: float,stock_price_high: float,stock_price_low: float,stock_price_close: float,
stock_volume: double,stock_price_adj_close: float);
Gr= GROUP Nasdaq BY stock_symbol;
St= FOREACH Gr GENERATE group, SUM(Gr.stock_volume) AS SVOLUME;
Sd= ORDER Sm BY SVOLUME DESC;
Ltd= LIMIT Srtd 10;

2 Answer(s)


0

You should have space before and after the equal sign.
For ex. Nasdaq= Load should be Nasdaq = Load

0

The load works fine. In fact, the script works fine till the Group statement. I don't get any data when I dump 'St', which creates the stock volume.
St= FOREACH Gr GENERATE group, SUM(Nasdaq.stock_volume) AS SVOLUME;
Dump St;