[
https://issues.apache.org/jira/browse/PIG-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13558234#comment-13558234
]
Cheolsoo Park commented on PIG-3090:
------------------------------------
Hi Jonathan,
This is very convenient. Thank you very much!
My only concern is that people might try this inside a nested block. Since an
alias inside a nested block is not a relation, it doesn't work. Nevertheless,
it may cause confusion to some people.
{code}
A = LOAD '1.txt';
B = GROUP A ALL;
C = FOREACH B {
D = FILTER A BY ($0 > 1);
E = FOREACH @ GENERATE $0; -- Can @ refer to D?
GENERATE E;
}
DUMP C;
{code}
Also we should document this if we're going to commit it.
> Introduce a syntax to be able to easily refer to the previously defined
> relation
> --------------------------------------------------------------------------------
>
> Key: PIG-3090
> URL: https://issues.apache.org/jira/browse/PIG-3090
> Project: Pig
> Issue Type: New Feature
> Reporter: Jonathan Coveney
> Assignee: Jonathan Coveney
> Fix For: 0.12
>
> Attachments: PIG-3090-0.patch, PIG-3090-1.patch
>
>
> Sometimes I feel like swimming with ANTLRs. This particular feature isn't too
> hard to add... and supports syntax like this:
> {code}
> a = load 'thing' as (x:int);
> b = foreach @ generate x;
> c = foreach @ generate x;
> d = foreach @ generate x;
> {code}
> I have a patch, though I need to make sure it doesn't change anything (it
> shouldn't) and I need to add tests.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira