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/10 02:06:02 UTC

Is this a known pig8->pig9 regression? Scoping within a foreach block

relation = load 'relation' as (val1:int,val2:int,val3:int);

b = load 'temp';

relation2 = FOREACH (GROUP relation BY val1) {
  a = COUNT(relation.val2);
  b = SUM(relation.val3);
  GENERATE group, (long)a, (long)b;
}

in pig 8 this works, in pig 9 it doesn't.

<file regress, line 8, column 33> Invalid scalar projection: b : A column
needs to be projected from a relation for it to be used as a scalar
Details at logfile: /var/log/pig/pig_1320887043189.log

Just wondering if this is a known issue, or if I should make a jira?

Re: Is this a known pig8->pig9 regression? Scoping within a foreach block

Posted by Daniel Dai <da...@hortonworks.com>.
Sounds something similar to PIG-2312.

Daniel

On Wed, Nov 9, 2011 at 10:53 PM, Jonathan Coveney <jc...@gmail.com>wrote:

> I definitely can work around it (and have :), but given it works
> differently in pig8 and pig9, I thought I'd mention it.
>
> 2011/11/9 Dmitriy Ryaboy <dv...@gmail.com>
>
> > looks like (long) b is getting the wrong b.
> > Make the names different?
> >
> >
> > On Wed, Nov 9, 2011 at 5:06 PM, Jonathan Coveney <jc...@gmail.com>
> > wrote:
> >
> > > relation = load 'relation' as (val1:int,val2:int,val3:int);
> > >
> > > b = load 'temp';
> > >
> > > relation2 = FOREACH (GROUP relation BY val1) {
> > >  a = COUNT(relation.val2);
> > >  b = SUM(relation.val3);
> > >  GENERATE group, (long)a, (long)b;
> > > }
> > >
> > > in pig 8 this works, in pig 9 it doesn't.
> > >
> > > <file regress, line 8, column 33> Invalid scalar projection: b : A
> column
> > > needs to be projected from a relation for it to be used as a scalar
> > > Details at logfile: /var/log/pig/pig_1320887043189.log
> > >
> > > Just wondering if this is a known issue, or if I should make a jira?
> > >
> >
>

Re: Is this a known pig8->pig9 regression? Scoping within a foreach block

Posted by Jonathan Coveney <jc...@gmail.com>.
I definitely can work around it (and have :), but given it works
differently in pig8 and pig9, I thought I'd mention it.

2011/11/9 Dmitriy Ryaboy <dv...@gmail.com>

> looks like (long) b is getting the wrong b.
> Make the names different?
>
>
> On Wed, Nov 9, 2011 at 5:06 PM, Jonathan Coveney <jc...@gmail.com>
> wrote:
>
> > relation = load 'relation' as (val1:int,val2:int,val3:int);
> >
> > b = load 'temp';
> >
> > relation2 = FOREACH (GROUP relation BY val1) {
> >  a = COUNT(relation.val2);
> >  b = SUM(relation.val3);
> >  GENERATE group, (long)a, (long)b;
> > }
> >
> > in pig 8 this works, in pig 9 it doesn't.
> >
> > <file regress, line 8, column 33> Invalid scalar projection: b : A column
> > needs to be projected from a relation for it to be used as a scalar
> > Details at logfile: /var/log/pig/pig_1320887043189.log
> >
> > Just wondering if this is a known issue, or if I should make a jira?
> >
>

Re: Is this a known pig8->pig9 regression? Scoping within a foreach block

Posted by Dmitriy Ryaboy <dv...@gmail.com>.
looks like (long) b is getting the wrong b.
Make the names different?


On Wed, Nov 9, 2011 at 5:06 PM, Jonathan Coveney <jc...@gmail.com> wrote:

> relation = load 'relation' as (val1:int,val2:int,val3:int);
>
> b = load 'temp';
>
> relation2 = FOREACH (GROUP relation BY val1) {
>  a = COUNT(relation.val2);
>  b = SUM(relation.val3);
>  GENERATE group, (long)a, (long)b;
> }
>
> in pig 8 this works, in pig 9 it doesn't.
>
> <file regress, line 8, column 33> Invalid scalar projection: b : A column
> needs to be projected from a relation for it to be used as a scalar
> Details at logfile: /var/log/pig/pig_1320887043189.log
>
> Just wondering if this is a known issue, or if I should make a jira?
>