title: Using PIG -how to order sum of two columns in desc and get the first 5 rows in the result
body: <pre><code>Flaglist = load '/flag.txt' using PigStorage (',') as (countryname:chararray, landmass:int, Zone:int, Area:int, Population:int, Language:int, Religion:int, Bars:int, stripes:int, Colours:int,red:int, green:int, blue:int,  gold:int, white:int, black:int, orange:int, mainhue:chararray, noofcircles:int, noofuprightcrosses:int, noofdiagonalcrosses:int, noofquarters:int, noofsunstarts:int, crescent:int, triangle:int, icon:int ,animate:int, text:int, topleft:chararray, bottomright:chararray );
  
  Sumofbs = FOREACH Flaglist GENERATE Bars+stripes  ;
  OrderBS = FOREACH Sumofbs GENERATE  Flaglist.countryname ;
  </code></pre>
  
  <p>ans:-</p>
  
  <blockquote>
    <p>2016-03-22 21:47:27,284 [main] INFO 
    org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher
    - Some jobs have failed! Stop running all dependent jobs 2016-03-22 21:47:27,358 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
    1066: Unable to open iterator for alias OrderBS. Backend error :
    <strong>Scalar has more than one row in the output. 1st :</strong> (Afghanistan,5,1,648,16,10,2,0,3,5,1,1,0,1,1,1,0,green,0,0,0,0,1,0,0,1,0,0,black,green),
    2nd
    :(Albania,3,1,29,3,6,6,0,0,3,1,0,0,1,0,1,0,red,0,0,0,0,1,0,0,0,1,0,red,red)</p>
  </blockquote>