$ cat data6
1
2
3
4
5

$ java -cp pig.jar org.apache.pig.Main -x local
a = load 'data6' as (x:chararray);
b = foreach a generate x as y:int;
c = foreach b generate y+y;
dump c;

Eventually:
java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Number
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.Add.genericGetNext(Add.java:89)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.Add.getNext(Add.java:114)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:344)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.processPlan(POForEach.java:353)
at
org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNext(POForEach.java:294)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.runPipeline(PigGenericMapBase.java:273)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:268)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapBase.map(PigGenericMapBase.java:64)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:212)


2012/6/19 Aniket Mokashi <[email protected]>

> I am not aware of the difference, can you please elaborate? That would help
> other users too [+user@pig?]...
>
> Thanks,
> Aniket
>
> On Tue, Jun 19, 2012 at 9:57 PM, Jonathan Coveney <[email protected]
> >wrote:
>
> > I cannot tell you the number of scripts I have had die because of this,
> and
> > the mass confusion it causes. Is there any reason why we can't just have
> >
> > "thing as alias:type" and "(type)thing as alias" be synonymous?
> >
>
>
>
> --
> "...:::Aniket:::... Quetzalco@tl"
>

Reply via email to