You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Olga Natkovich (JIRA)" <ji...@apache.org> on 2011/07/21 19:56:58 UTC

[jira] [Updated] (PIG-2184) Not able to provide positional reference to macro invocations

     [ https://issues.apache.org/jira/browse/PIG-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olga Natkovich updated PIG-2184:
--------------------------------

    Fix Version/s: 0.10

> Not able to provide positional reference to macro invocations
> -------------------------------------------------------------
>
>                 Key: PIG-2184
>                 URL: https://issues.apache.org/jira/browse/PIG-2184
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Vivek Padmanabhan
>             Fix For: 0.10
>
>
> It looks like the macro functionality doesnt support for positional references. The below is an example script;
> ----------------------------------------------------------------------------
> DEFINE my_macro (X,key) returns Y
>         {
>         tmp1 = foreach  $X generate TOKENIZE((chararray)$key) as tokens;
>         tmp2 = foreach tmp1 generate flatten(tokens);
>         tmp3 = order tmp2 by $0;
>         $Y = distinct tmp3;
>         }
> A = load 'sometext' using TextLoader() as (row1) ;
> E = my_macro(A,A.$0);
> dump E;
> ----------------------------------------------------------------------------
> This script execution fails at parsing staging itself;
> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file try1.pig, line 16,
> column 16>  mismatched input '.' expecting RIGHT_PAREN
> If i replace A.$0 with the field name ie row1 the script runs fine.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira