One issue I see at first glance is the hyphen in the relation max-runs; change that to an underscore or remove it.
> On Mar 15, 2014, at 1:33 AM, Sivaraja Babu <[email protected]> wrote: > > MY SCRIPT > TAB1 = LOAD '/Batting-edited.csv' USING PigStorage(',') as > (playerID,yearID,stint,teamID,lgID,G,G_batting:int,AB,G_old); > > Runs = foreach TAB1 generate playerID, yearID, G_batting; > > grp_data = group Runs by (yearID); > > *max-runs = foreach grp_data generate group as grp, max(Runs.G_batting) as > maxrun; ==> Error here* > > ERROR > ========================================>----------- > org.apache.pig.tools.pigscript.parser.ParseException: Encountered " <PATH> > "max-runs "" at line 1, column 1. > Was expecting one of: > > ========================================>-------------- > > Sample data till grp_data > > *TAB1* > ____________________________________________________________________________________________ > | allisdo01 | 1878 | 1 > | PRO | NL | 19 | 19 > | 76 | 19 | > | | bondto01 | 1878 | 1 > | BSN | NL | 59 | 59 > | 236 | 59 | > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > -------------------------------------------------------------------------------- > | *Runs *| playerID:bytearray | yearID:bytearray | > G_batting:int | > -------------------------------------------------------------------------------- > | | allisdo01 | 1878 | 19 > | > | | bondto01 | 1878 | 59 > | > -------------------------------------------------------------------------------- > -------------------------------------------------------------------------------------------------------------------------------- > | *grp_data* | group:bytearray | > Runs:bag{:tuple(playerID:bytearray,yearID:bytearray,G_batting:int)} > | > -------------------------------------------------------------------------------------------------------------------------------- > | | 1878 | {(allisdo01, 1878, 19), (bondto01, > 1878, 59)} | > -------------------------------------------------------------------------------------------------------------------------------- > > *grunt> max-runs = foreach grp_data generate group as grp, > max(Runs.G_batting) as maxrun;* > *2014-03-15 01:07:32,363 [main] ERROR org.apache.pig.tools.grunt.Grunt - > ERROR 1000: Error during parsing. Encountered " <PATH> "max-runs "" at line > 3, column 1.* > *--------------------------*
