You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Alan Gates (JIRA)" <ji...@apache.org> on 2011/03/02 02:08:36 UTC
[jira] Commented: (PIG-1877) map constants not working properly in
filter statements
[ https://issues.apache.org/jira/browse/PIG-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001221#comment-13001221 ]
Alan Gates commented on PIG-1877:
---------------------------------
Tuple constants appear to have the same issue.
> map constants not working properly in filter statements
> -------------------------------------------------------
>
> Key: PIG-1877
> URL: https://issues.apache.org/jira/browse/PIG-1877
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.8.0
> Reporter: Alan Gates
> Priority: Minor
>
> The Pig Latin script:
> {code}
> A = load '/Users/gates/test/data/studenttab10' as (a:map[], b:tuple(), c:bag{});
> B = filter A by a == ['name'#'bob', 'age'#55];
> dump B;
> {code}
> runs but produces the error:
> {code}
> java.lang.ClassCastException: java.util.HashMap cannot be cast to org.apache.pig.data.DataByteArray
> at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression.getNext(ConstantExpression.java:112)
> at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.EqualToExpr.getNext(EqualToExpr.java:75)
> at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POFilter.getNext(POFilter.java:148)
> at org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:276)
> at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNext(POForEach.java:240)
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.runPipeline(PigMapBase.java:236)
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.map(PigMapBase.java:231)
> at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.map(PigMapBase.java:53)
> at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:621)
> at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
> at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:177)
> {code}
> But if I change the script to
> {code}
> A = load '/Users/gates/test/data/studenttab10' as (a:map[], b:tuple(), c:bag{});
> B = foreach A generate a, ['name'#'bob', 'age'#55] as b;
> C = filter B by a == b;
> dump C;
> {code}
> which is semantically equivalent, the job passes.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira