[
https://issues.apache.org/jira/browse/PIG-2378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Johnny Zhang updated PIG-2378:
------------------------------
Attachment: PIG-2378.patch.txt
this is a working patch resolving the issue. Now you don't have to use the
quote hacky working around, you can use relation.filed directly as macro
argument. For the test data I described above, it finally generate results
{noformat}
((2,3),{(1,(2,3))})
((2,4),{(4,(2,4))})
((7,8),{(6,(7,8))})
{noformat}
I will run full unit tests see if any regression it brings, since it touches
file LogicalSchema.java, which is used by many other places. Meanwhile, improve
the code efficiency as much as possible.
> macros don't accept references to items within tuples as arguments
> ------------------------------------------------------------------
>
> Key: PIG-2378
> URL: https://issues.apache.org/jira/browse/PIG-2378
> Project: Pig
> Issue Type: Improvement
> Affects Versions: 0.9.1
> Reporter: Joseph Adler
> Assignee: Johnny Zhang
> Attachments: PIG-2378.patch.txt
>
>
> I'd like to be able to pass a reference to an item within a parameter to a
> Pig Macro.
> For example, suppose that I had a relation A with the schema A:{id:long,
> header:(time:long, type:chararray)}. I'd like to call a macro by typing:
> B = MY_MACRO(A, header.time);
> but this does not currently work. Obviously, I could define a new relation as
> a workaround, for example I could use some pig code like
> AA = FOREACH a GENERATE *, header.time as time;
> B = MY_MACRO(AA, time);
> But that's ugly and clunky
--
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