You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Johnny Zhang (JIRA)" <ji...@apache.org> on 2013/03/27 01:37:15 UTC

[jira] [Commented] (PIG-2265) Test case TestSecondarySort failure

    [ https://issues.apache.org/jira/browse/PIG-2265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13614734#comment-13614734 ] 

Johnny Zhang commented on PIG-2265:
-----------------------------------

current the test is disabled in trunk.

I enable it and can reproduce the issue. I think it is the same root cause as PIG-3049. [~cheolsoo] help me debug this issue a while back, and explains to me idea.

The reason seems when secondary sort is enabled, the code needs inform POProject.java to process secondary sort key properly to avoid cast from the content of the tuple to tuple by
POProject.java line 481
{code}
res.result = (Tuple)ret;
{code}

the fix should be something like
POProject.java line 422
change
{code}
ret = inpValue.get(columns.get(0));
{code}

to
{code}
if (secondarySort) {
    ret = inpValue;
} else {
    ret = inpValue.get(columns.get(0));
}
{code}

it is not clear to me whether this is the right guess, and don't have idea how to get the boolean value secondarySort in POProject.java though.
                
> Test case TestSecondarySort failure
> -----------------------------------
>
>                 Key: PIG-2265
>                 URL: https://issues.apache.org/jira/browse/PIG-2265
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0
>            Reporter: Shengjun Xin
>
> Error message:
> Testcase: testNestedSortEndToEnd3 took 53.076 sec
> 	Caused an ERROR
> Unable to open iterator for alias E. Backend error : org.apache.pig.data.DataByteArray cannot be cast to org.apache.pig.data.Tuple
> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable to open iterator for alias E. Backend error : org.apache.pig.data.DataByteArray cannot be cast to org.apache.pig.data.Tuple
> 	at org.apache.pig.PigServer.openIterator(PigServer.java:742)
> 	at org.apache.pig.test.TestSecondarySort.testNestedSortEndToEnd3(TestSecondarySort.java:550)
> Caused by: java.lang.ClassCastException: org.apache.pig.data.DataByteArray cannot be cast to org.apache.pig.data.Tuple
> 	at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POProject.getNext(POProject.java:392)
> 	at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POLocalRearrange.getNext(POLocalRearrange.java:357)
> 	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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira