When I run my script with the command showed below, with police_force parameter set as "Surrey Police", it gives me an error
"ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. File not found: Police""
If I pass in the value as "Surrey_Police" it runs fine but doesn't return anything
-- knownvalues: dataset presented
-- date1: one date of comparison
-- date2: 2nd date of comparison
-- police_force: falls within
-- crime_type
-- Usage: exec -param knownvalues='/user/cw/input/all.txt' -param date1='2017-05' -param date2='2017-06' -param police_force="Surrey Police" /home/xiaorui/CW/compare_crime.pig
knownvalues = LOAD '$knownvalues' USING PigStorage(',') AS (crimeid:chararray,month:chararray,reportedby:chararray,fallswithin:chararray,longitude:float,latitude:float,location:chararray,lsoacode:chararray,lsoaname:chararray,crimetype:chararray,lastoutcome:chararray,context:chararray);
knownvalues = SAMPLE knownvalues 0.00001;
location = FILTER knownvalues BY (fallswithin MATCHES $police_force);
first_date = FILTER location BY (month MATCHES '$date1');
second_date = FILTER location BY (month MATCHES '$date2');
DUMP first_date;
If i use the line below, code works as intended
location = FILTER knownvalues BY (fallswithin MATCHES 'Surrey Police');