Pig script to query and sort map/reduce result