Home | About | Sematext search-lucene.com search-hadoop.com
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
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Escaping Dollar Sign in Map in Pig 0.10


Copy link to this message
-
Re: Escaping Dollar Sign in Map in Pig 0.10
Thanks Dmitriy, but no dice. It returns the whole thing to me with post_id as blank. I think with two backslashes it ends up looking for a backslash in the key (i.e. '\$id') which doesn't exist. I also tried the unicode for the dollar symbol \\u0024.

Eli

On Jan 10, 2013, at 7:33 PM, Dmitriy Ryaboy wrote:

> Two back slashes?
>
>
> On Thu, Jan 10, 2013 at 6:01 PM, Eli Finkelshteyn <[EMAIL PROTECTED]>wrote:
>
>> 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?
>>
>> Thanks!
>> Eli
>>

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