Cogroup has inner plans that compute the group by attributes. Instead of
looking at the predecessor(s), you should navigate the inner plan of
cogroup. Check out the code in
(visit(LOCogroup ...) method)
From: Dmitriy Ryaboy [mailto:dvrya...@gmail.com]
Sent: Sunday, February 15, 2009 9:07 PM
Subject: Determining the group-by column
We are working on the Pig Logical Optimizer, and running into some
difficulty navigating the plan.
If we run explain on a query with a CoGroup, we get something like:
| |-- Project 
What we want to do is determine that this particular Cogroup operates on
projection of field 0.
If we create a new LogicalTransformer that is applied to Cogroup
mPlan.getPredecessors(ourCogroupOperator) , we only get the ForEach.
Calling getSuccessors results in a null being returned (Cogroup is
How do we find the Project operator above? What is its relationship,
plan-wise, with the Cogroup operator?
Thanks a lot,
Dmitriy Ryaboy, Ashutosh Chauhan, Tejal Desai