I'm still struggling with parameter substitution.
Below are six examples. Two work, the others don't.
When they don't, I get this error message:
ERROR org.apache.pig.Main - ERROR 2999: Unexpected internal error.
Encountered unexpected arguments on command line - please check the
$ pig -param COLOR=blue script.pig -- Works
$ pig -param COLOR="blue-green" script.pig -- Works
$ pig -param COLOR="blue green" script.pig -- Fails
$ pig -param COLOR="'blue green'" script.pig -- Fails
$ pig -param COLOR="\'blue green\'" script.pig -- Fails
$ pig -param COLOR="blue\ green" script.pig -- Fails
How do I protect spaces so that I can pass multi-word
parameters into Pig?
On Tue, Mar 15, 2011 at 7:23 AM, Alan Gates wrote:
If you know before you start the script which you want, you can use
A = load 'foo';
Z = foreach Y generate ...;
Then, depending on which you want, run pig with
pig -pDO_OUTPUT='dump Z;';
pig -pDO_OUTPUT="store Z into 'outfile';"
If you want to decide which to do based on results of the script, then
you'll need the new control flow integration features available in 0.9.
These aren't yet released, but they are in trunk.
On Mar 14, 2011, at 10:40 PM, Andreas Paepcke wrote:
I want to do something really simple: I want to pass a string
into a Pig script. The string is either "stdout" or some target
file name. Say the string gets bound to $OUTPUT. That all
After the script has computed a result R, depending on the
value of $OUTPUT, I want either to do a dump R (if
$OUTPUT == "stdout"), or a STORE of R into the given
file name that's held in $OUTPUT.
How do I do that conditional? I played with bincond, but