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

Alan Gates resolved PIG-453.
----------------------------

    Resolution: Won't Fix

I agree the endless appending of x:: to the front can get tiresome.  But users 
are free to assign new aliases in the foreach rather than allowing us to use 
the default naming schema.  And in the case of a double corgroup, this might 
actually be necessary for disambiguation.  Consider, for example:

{code}
A = load 'input1' as (x, y, z);
B = load 'input2' as (x, y, z);
C = load 'input3' as (x, y, z);
D = cogroup A by x, B by x;
E = foreach D generate flatten(A), flatten(B);
F = cogroup E by A::x, C by x;
G = foreach F generate flatten(E), flatten(C);
{code}

Now I have to specify E::A::x to differentiate it from E::B::x and C::x.



> Scope resolution operators in flattened schemas need to be fixed
> ----------------------------------------------------------------
>
>                 Key: PIG-453
>                 URL: https://issues.apache.org/jira/browse/PIG-453
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Santhosh Srinivasan
>            Assignee: Alan Gates
>            Priority: Minor
>             Fix For: 0.9.0
>
>
> Currently, the scope resolution operator :: is stored as part of the field 
> schema alias. As a result, users may get confused by queries like:
> {code}
> a = load 'st10k' as (name, age, gpa);
> b = group a by name;
> c = foreach b generate flatten(a);
> d = filter c by name != 'fred';
> e = group d by name;
> f = foreach e generate flatten(d);
> g = foreach f generate name;
> {code}
> With PIG-451, the schema for f will have a column with aliases a::name and 
> d::a::name. The use of d::a::name is particularly confusing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to