Use parameter substitution -


-----Original Message-----
From: Latha [mailto:[EMAIL PROTECTED]]
Sent: Saturday, October 04, 2008 6:33 PM
Subject: How to pass arguments to PigScript; + How to compare data atoms
within pig script


My requirement is to search an input string in a given file and output
lines of the file that contains the string.

Am writing the following searchString.pig script( Have integrated hadoop
with pig. Hence, all my files are available at hdfs) : text file will have a single word 'sample' .
indexFile             : text file will have 10 key-value pairs separated
space,  with word 'sample' appearing in 2 or 3 lines.


 searchStr = load '' using PigStorage();
 A = load 'indexFile' using PigStorage(' ') as (str,filename);
-- This string comparision works!
 Y = FILTER A BY str eq  'abc';

--None of the below works
 Y = FILTER A BY str eq searchStr ;
 Y = FILTER A BY str eq searchStr.$0;
Instead of hardcoding the search string, I would like to search the
available at searchStr dataatom.
1. Which way can i compare "A.str" with "searchStr" data atom?
2. Is there a way i can pass search string as an argument to the Pig

Thankyou for your assistance.
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB