You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "liyunzhang_intel (JIRA)" <ji...@apache.org> on 2016/08/09 07:59:20 UTC
[jira] [Updated] (PIG-4968) Fix unit test failure of
TestLogicalPlanBuilder#testQuery90
[ https://issues.apache.org/jira/browse/PIG-4968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
liyunzhang_intel updated PIG-4968:
----------------------------------
Attachment: PIG-4968.patch
[~daijy] and [~knoguchi]:
Can you help review this patch as you are familar with PIG-2315(Make as clause work in generate) if you have time.
Changes:
1. change the expected result to make the unit test pass.
> Fix unit test failure of TestLogicalPlanBuilder#testQuery90
> ------------------------------------------------------------
>
> Key: PIG-4968
> URL: https://issues.apache.org/jira/browse/PIG-4968
> Project: Pig
> Issue Type: Bug
> Reporter: liyunzhang_intel
> Assignee: liyunzhang_intel
> Attachments: PIG-4968.patch, PIG-4968.patch
>
>
> In jenkins, [it |https://builds.apache.org/job/Pig-trunk/1935/#showFailuresLink] shows that TestLogicalPlanBuilder#testQuery90 fails. After debugging, it always fails in
> [Line1139 |https://github.com/apache/pig/blob/trunk/test/org/apache/pig/test/TestLogicalPlanBuilder.java#L1138]
> {code}
> Assert.assertTrue(foreach.getSchema().toString( false ).equals("mygroup:tuple(myname:chararray,myage:int),mycount:long"));
> {code}
> The script is
> {code}
> a = load 'myfile' as (name:Chararray, age:Int, gpa:Float);b = group a by (name, age);c = foreach b generate group as mygroup:(myname, myage), COUNT(a) as mycount;store c into 'output';
> {code}
>
> The reason why fails is because the schema of mygroup(myname,myage) is
> mygroup(myname:bytearray,myage:bytearray) and this user-defined schema is assigned to c. so the schema of c is
> not mygroup:tuple(myname:chararray,myage:int) but mygroup:tuple(myname:bytearray,myage:bytearray).
> This problem is imported since PIG-2315 as ForEachUserSchemaVisitor is used in [LogicalPlan|https://github.com/apache/pig/blob/trunk/src/org/apache/pig/newplan/logical/relational/LogicalPlan.java#L179].
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)