Current TOP implementation needlessly results in a null bag name
----------------------------------------------------------------

                 Key: PIG-2365
                 URL: https://issues.apache.org/jira/browse/PIG-2365
             Project: Pig
          Issue Type: Improvement
    Affects Versions: 0.9.1, 0.10
            Reporter: Jonathan Coveney
            Priority: Minor
             Fix For: 0.10, 0.9.2
         Attachments: top.patch

Given that TOP is basically always used with FLATTEN, now that FLATTEN prepends 
the bag name, the output is suboptimal.

a = load 'thing' as (x:int, y:int, z:int);
b = group a all;
c = foreach b generate flatten(TOP(10,1,a));
describe c;
--currently: c: {null::x: int,null::y: int,null::z: int}
--without a one line change could be: c: {a::x: int,a::y: int,a::z: int}

The current implementation actually throws away this info, so it's just a 
matter of not doing that. Patch attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to