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 Plain View
Pig >> mail # user >> error to generate a map?


+
Yang 2012-06-08, 03:51
Copy link to this message
-
Re: error to generate a map?
Maps require string keys.  So it should read ['222'#1].

Alan.

On Jun 7, 2012, at 8:51 PM, Yang wrote:

> I ran the following simple pig script
>
>
> a = load 'a';
>
> b = foreach a generate [222#1];
>
> dump b;
>
>
> but it gave the following error
>
> $ pig -x local  a.pig
> 2012-06-07 20:49:13,039 [main] INFO  org.apache.pig.Main - Logging error
> messages to:
> /crypt/yyang_home/work/matching/ML-places-matcher/control_flows/match_suspects/pig_1339127353036.log
> 2012-06-07 20:49:13,168 [main] INFO
> org.apache.pig.backend.hadoop.executionengine.HExecutionEngine -
> Connecting to hadoop file system at: file:///
> 2012-06-07 20:49:13,692 [main] ERROR org.apache.pig.tools.grunt.Grunt -
> ERROR 1200: <file a.pig, line 3, column 23>  Syntax error, unexpected
> symbol at or near '['
>
>
>
> but this script is basically the same as the one copied from manual:
> http://pig.apache.org/docs/r0.9.2/basic.html
>
> A = LOAD 'data' USING MyStorage() AS (T: tuple(name:chararray, age: int));
> B = FILTER A BY T == ('john', 25);
> D = FOREACH B GENERATE T.name, [25#5.6], {(1, 5, 18)};
>
>
>
> how could I fix it?
>
>
>
> thanks!
>
> yang
+
Yang 2012-06-20, 22:56
+
Yang 2012-06-20, 23:00
+
Yang 2012-06-20, 23:28
+
Daniel Dai 2012-06-27, 18:58
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