pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Gates (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-1877) map constants not working properly in filter statements
Date Wed, 02 Mar 2011 01:00:43 GMT
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

        

Mime
View raw message