Do you have relations ned sent, opened, etc, elsewhere in the script?
On May 31, 2012, at 12:09 PM, Steve Bernstein <[email protected]> wrote:
> We upgraded from Pig 0.8.1 to 0.10 and the following nested foreach no longer
> works:
>
> actionBagGrouped = GROUP actionBag BY (deal_id,month);
> dealCounts = FOREACH actionBagGrouped {
> sent = FILTER actionBag BY action=='sent';
> opened = FILTER actionBag BY action=='opened';
> clicked = FILTER actionBag BY action=='clicked';
> purchased = FILTER actionBag BY action=='purchased';
>
> GENERATE
> FLATTEN(group),
> COUNT(sent) AS sentCount,
> COUNT(opened) AS openedCount,
> COUNT(clicked) AS clickedCount,
> COUNT(purchased) AS purchasedCount;
> };
> I get:
> "Invalid scalar projection: action : A column needs to be projected from a
> relation for it to be used as a scalar"
> Banging my head against a wall-the problem is with the nest op sent =
> Filter...
>
> Help!
> Thanks-
> Steve