title: how to define a constant array and check if a value is in the array for Pig Latin
body: <p>I want to define an array of user Ids in Pig and then filter data if the userId from the input is NOT in that array,
  How do I do this in pig latin? Below is the example of what I intend to do</p>
  
  <p>Thanks</p>
  
  <pre><code>inputData = load '$INPUT' USING PigStorage('|') AS (useriD:chararray,controllerAction:chararray,url:chararray,browserName:chararray,IsMobile:chararray,exceptionDetails:chararray,renderTime:int,serviceHostId:int,auditEventTime:chararray);
  filteredInput = filter inputData by controllerAction is not null and auditEventTime is not null and serviceHostId is not null and renderTime is not null and useriD in ('2be2df06-f4ba-4d87-8938-09d867d3f2fe','ac1ac6bf-d151-49fc-8c7c-2b52d2efbb58','f00aec16-36e5-46ae-b7cb-a0f1eeefe609','258890f9-102a-4f8e-a001-ae24d2e25269','cf221779-a077-472c-b377-cca4a9230e1b');
  </code></pre>
  
  <p>Thanks Murali..I tried the approach of declaring a variable and then using Flatten and stringSplit to join..However I get the following error
   Syntax error, unexpected symbol at or near 'flatteneduserids'</p>
  
  <pre><code>%declare REQUIRED_USER_IDS 'xxxxx,yyyyy,sssss' ;
  
  inputData = load '$INPUT' USING PigStorage('|') AS (useriD:chararray,controllerAction:chararray,url:chararray,browserName:chararray,IsMobile:chararray,exceptionDetails:chararray,renderTime:int,serviceHostId:int,auditEventTime:chararray);
  
  filteredInput = filter inputData by controllerAction is not null and auditEventTime is not null and serviceHostId is not null and renderTime is not null;
  
  flatteneduserids = FLATTEN(STRSPLIT('$REQUIRED_USER_IDS',',')) AS (uid:chararray);
  
  useridfilter = JOIN filteredInput BY useriD, flatteneduserids BY  uid USING 'replicated';
  </code></pre>
  
  <p>so Now I tried another way of declaring flatteneduserids which results in the error Undefined alias: IN</p>
  
  <pre><code>flatteneduserids = FOREACH IN GENERATE FLATTEN(STRSPLIT('$REQUIREDUSERIDS',',')) AS (uid:chararray);
  </code></pre>