This wasn’t a problem in 0.9.2, but in 0.10, when I try to access a key in a map that has a dollar sign in it, I get hammered with errors that I haven’t defined the variable. Specifically:
blah = FOREACH meh GENERATE source, json_post_id#'$id' AS post_id;
returns
Undefined parameter : id
That’s fine and makes sense, but when I amend it to:
blah = FOREACH meh GENERATE source, json_post_id#'\$id' AS post_id;
I get:
Unexpected character '$'
Ideas?
[Edit] Forgot to mention: have tried with 2 backslashes and 3 backslashes as well. No dice. [/Edit]
Based on a response to your Mail Archive Posting, it looks like the behavior will be “different when using Grunt shell and running it as a script.”
Also, from Pig problem with split string(STRSPLIT), have you tried either of the following.
Correctly escaping the character
u0024. Test single using single or double quotes to see if that makes a difference. This answer shows that the single quote makes a difference which you have but it’s worth mentioning.Alternatively, although related, break the loop into a block.
It looks like you are concatenating an
id. Make sure you are not suppose to be usingCONCAT(). http://pig.apache.org/docs/r0.10.0/func.html#concatAccording to the
Class PigStoragedocumentation (Pig 0.10.0 API):