The above code generates wrong results when executed with Pig 0.10 and Pig 0.9
The below is the sample input;
I think the Pig optimizers are causing this issue.From the logs I can see that the $1 is pruned for the relation A.
[main] INFO org.apache.pig.newplan.logical.rules.ColumnPruneVisitor - Columns pruned for A: $1
One workaround for this is to disable -t ColumnMapKeyPrune.