You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by Jonathan Coveney <jc...@gmail.com> on 2011/11/11 05:27:13 UTC

Another possible unknown bug with foreach?

This one is really whacky, just wondering if this is a known issue? I've
noted the difference

a = load 'thing' as (v0,v1,v2);

b = GROUP a BY v0;

c = FOREACH b {

   ordered = ORDER a BY v1 ASC;

   t1 = LIMIT ordered 3;

   ordered2 = ORDER a BY v1 DESC, v2 ASC;

   t2 = LIMIT ordered 3; --references ordered

   GENERATE group, t1.v2 as x2, t2.v2 as x4;

}

describe c;


--returns: c: {v0: bytearray,v1: bytearray,v2: bytearray}

a = load 'thing' as (v0,v1,v2);

b = GROUP a BY v0;

c = FOREACH b {

   ordered = ORDER a BY v1 ASC;

   t1 = LIMIT ordered 3;

   ordered2 = ORDER a BY v1 DESC, v2 ASC;

   t2 = LIMIT ordered2 3; --references ordered2

   GENERATE group, t1.v2 as x2, t2.v2 as x4;

}

describe c;

returns: c: {group: bytearray,x2: {(v2: bytearray)},x4: {(v2: bytearray)}}

The latter is the correct one, but the former shouldn't return the schema
of b (which is what it does: I ran into this bug oddly because the script
had a bug where it referred to the wrong relation, but it shouldn't return
the schema of b!)

Should I make a ticket?

Re: Another possible unknown bug with foreach?

Posted by Daniel Dai <da...@hortonworks.com>.
Thanks, I will take a look.

On Fri, Nov 11, 2011 at 1:03 AM, Jonathan Coveney <jc...@gmail.com>wrote:

> yessir
>
> https://issues.apache.org/jira/browse/PIG-2357
>
> 2011/11/11 Daniel Dai <da...@hortonworks.com>
>
> > explain show the right plan, but describe wrong. Please open a ticket.
> >
> > Daniel
> >
> > On Thu, Nov 10, 2011 at 8:27 PM, Jonathan Coveney <jcoveney@gmail.com
> > >wrote:
> >
> > > This one is really whacky, just wondering if this is a known issue?
> I've
> > > noted the difference
> > >
> > > a = load 'thing' as (v0,v1,v2);
> > >
> > > b = GROUP a BY v0;
> > >
> > > c = FOREACH b {
> > >
> > >   ordered = ORDER a BY v1 ASC;
> > >
> > >   t1 = LIMIT ordered 3;
> > >
> > >   ordered2 = ORDER a BY v1 DESC, v2 ASC;
> > >
> > >   t2 = LIMIT ordered 3; --references ordered
> > >
> > >   GENERATE group, t1.v2 as x2, t2.v2 as x4;
> > >
> > > }
> > >
> > > describe c;
> > >
> > >
> > > --returns: c: {v0: bytearray,v1: bytearray,v2: bytearray}
> > >
> > > a = load 'thing' as (v0,v1,v2);
> > >
> > > b = GROUP a BY v0;
> > >
> > > c = FOREACH b {
> > >
> > >   ordered = ORDER a BY v1 ASC;
> > >
> > >   t1 = LIMIT ordered 3;
> > >
> > >   ordered2 = ORDER a BY v1 DESC, v2 ASC;
> > >
> > >   t2 = LIMIT ordered2 3; --references ordered2
> > >
> > >   GENERATE group, t1.v2 as x2, t2.v2 as x4;
> > >
> > > }
> > >
> > > describe c;
> > >
> > > returns: c: {group: bytearray,x2: {(v2: bytearray)},x4: {(v2:
> > bytearray)}}
> > >
> > > The latter is the correct one, but the former shouldn't return the
> schema
> > > of b (which is what it does: I ran into this bug oddly because the
> script
> > > had a bug where it referred to the wrong relation, but it shouldn't
> > return
> > > the schema of b!)
> > >
> > > Should I make a ticket?
> > >
> >
>

Re: Another possible unknown bug with foreach?

Posted by Jonathan Coveney <jc...@gmail.com>.
yessir

https://issues.apache.org/jira/browse/PIG-2357

2011/11/11 Daniel Dai <da...@hortonworks.com>

> explain show the right plan, but describe wrong. Please open a ticket.
>
> Daniel
>
> On Thu, Nov 10, 2011 at 8:27 PM, Jonathan Coveney <jcoveney@gmail.com
> >wrote:
>
> > This one is really whacky, just wondering if this is a known issue? I've
> > noted the difference
> >
> > a = load 'thing' as (v0,v1,v2);
> >
> > b = GROUP a BY v0;
> >
> > c = FOREACH b {
> >
> >   ordered = ORDER a BY v1 ASC;
> >
> >   t1 = LIMIT ordered 3;
> >
> >   ordered2 = ORDER a BY v1 DESC, v2 ASC;
> >
> >   t2 = LIMIT ordered 3; --references ordered
> >
> >   GENERATE group, t1.v2 as x2, t2.v2 as x4;
> >
> > }
> >
> > describe c;
> >
> >
> > --returns: c: {v0: bytearray,v1: bytearray,v2: bytearray}
> >
> > a = load 'thing' as (v0,v1,v2);
> >
> > b = GROUP a BY v0;
> >
> > c = FOREACH b {
> >
> >   ordered = ORDER a BY v1 ASC;
> >
> >   t1 = LIMIT ordered 3;
> >
> >   ordered2 = ORDER a BY v1 DESC, v2 ASC;
> >
> >   t2 = LIMIT ordered2 3; --references ordered2
> >
> >   GENERATE group, t1.v2 as x2, t2.v2 as x4;
> >
> > }
> >
> > describe c;
> >
> > returns: c: {group: bytearray,x2: {(v2: bytearray)},x4: {(v2:
> bytearray)}}
> >
> > The latter is the correct one, but the former shouldn't return the schema
> > of b (which is what it does: I ran into this bug oddly because the script
> > had a bug where it referred to the wrong relation, but it shouldn't
> return
> > the schema of b!)
> >
> > Should I make a ticket?
> >
>

Re: Another possible unknown bug with foreach?

Posted by Daniel Dai <da...@hortonworks.com>.
explain show the right plan, but describe wrong. Please open a ticket.

Daniel

On Thu, Nov 10, 2011 at 8:27 PM, Jonathan Coveney <jc...@gmail.com>wrote:

> This one is really whacky, just wondering if this is a known issue? I've
> noted the difference
>
> a = load 'thing' as (v0,v1,v2);
>
> b = GROUP a BY v0;
>
> c = FOREACH b {
>
>   ordered = ORDER a BY v1 ASC;
>
>   t1 = LIMIT ordered 3;
>
>   ordered2 = ORDER a BY v1 DESC, v2 ASC;
>
>   t2 = LIMIT ordered 3; --references ordered
>
>   GENERATE group, t1.v2 as x2, t2.v2 as x4;
>
> }
>
> describe c;
>
>
> --returns: c: {v0: bytearray,v1: bytearray,v2: bytearray}
>
> a = load 'thing' as (v0,v1,v2);
>
> b = GROUP a BY v0;
>
> c = FOREACH b {
>
>   ordered = ORDER a BY v1 ASC;
>
>   t1 = LIMIT ordered 3;
>
>   ordered2 = ORDER a BY v1 DESC, v2 ASC;
>
>   t2 = LIMIT ordered2 3; --references ordered2
>
>   GENERATE group, t1.v2 as x2, t2.v2 as x4;
>
> }
>
> describe c;
>
> returns: c: {group: bytearray,x2: {(v2: bytearray)},x4: {(v2: bytearray)}}
>
> The latter is the correct one, but the former shouldn't return the schema
> of b (which is what it does: I ran into this bug oddly because the script
> had a bug where it referred to the wrong relation, but it shouldn't return
> the schema of b!)
>
> Should I make a ticket?
>