[ 
https://issues.apache.org/jira/browse/PIG-5453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Koji Noguchi updated PIG-5453:
------------------------------
    Attachment: pig-5453-v01.patch

Uploading the patch that uses a new field introduced as part of PIG-5201, 
PIG-5452.  If number of fields are less than the expected number of fields, it 
will now fills the rest with null.   If number of fields are more, then it 
would now fills up to the expected number of fields only.  (pig-5453-v01.patch) 

> FLATTEN shifting fields incorrectly
> -----------------------------------
>
>                 Key: PIG-5453
>                 URL: https://issues.apache.org/jira/browse/PIG-5453
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>            Priority: Major
>         Attachments: pig-5453-v01.patch
>
>
> Follow up from PIG-5201, PIG-5452.  
> When flatten-ed tuple has less or more fields than specified, entire fields 
> shift incorrectly. 
> Input
> {noformat}
> A       (a,b,c)
> B       (a,b,c)
> C       (a,b,c)
> Y       (a,b)
> Z       (a,b,c,d,e,f)
> E{noformat}
> Script
> {code:java}
> A = load 'input.txt' as (a1:chararray, a2:tuple());
> B = FOREACH A GENERATE a1, FLATTEN(a2) as 
> (b1:chararray,b2:chararray,b3:chararray), a1 as a4;
> dump B; {code}
> Incorrect results
> {noformat}
> (A,a,b,c,A)
> (B,a,b,c,B)
> (C,a,b,c,C)
> (Y,a,b,Y,)
> (Z,a,b,c,d)
> (E,,,,E){noformat}
> E is correct.  It's fixed as part of PIG-5201, PIG-5452.
> Y has shifted a4(Y) to the left incorrectly.  
> Should have been (Y,a,b,,Y)
> Z has dropped a4(Z) and overwrote the result with content of FLATTEN(a2).
> Should have been (Z,a,b,c,Z).
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to