You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Russell Jurney <ru...@gmail.com> on 2012/04/12 01:34:39 UTC
Macros in Grunt?
/* Filter emails according to existence of header pairs: [from, to, cc,
bcc, reply_to]
Then project the header part, message_id and subject, and emit them,
lowercased. */
DEFINE headers_messages(email, col) RETURNS set {
filtered = FILTER $email BY ($col IS NOT NULL);
flat = FOREACH filtered GENERATE FLATTEN($col) AS $col, message_id,
subject;
$set = FOREACH flat GENERATE LOWER($col) AS address, message_id, subject;
}
This works when I run the script from bash, but fails in Grunt. Does Grunt
support macros?
--
Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com
Re: Macros in Grunt?
Posted by Alan Gates <ga...@hortonworks.com>.
No, Grunt does not support macros. Macros depend on a pre-processor which Grunt does not run.
Alan.
On Apr 11, 2012, at 4:34 PM, Russell Jurney wrote:
> /* Filter emails according to existence of header pairs: [from, to, cc,
> bcc, reply_to]
> Then project the header part, message_id and subject, and emit them,
> lowercased. */
> DEFINE headers_messages(email, col) RETURNS set {
> filtered = FILTER $email BY ($col IS NOT NULL);
> flat = FOREACH filtered GENERATE FLATTEN($col) AS $col, message_id,
> subject;
> $set = FOREACH flat GENERATE LOWER($col) AS address, message_id, subject;
> }
>
> This works when I run the script from bash, but fails in Grunt. Does Grunt
> support macros?
>
> --
> Russell Jurney twitter.com/rjurney russell.jurney@gmail.com datasyndrome.com