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

Olga Natkovich updated PIG-2007:
--------------------------------

      Description: 
The below script when executed with version 0.9 fails with parsing error.

{code}
 ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. 
<line 2, column 15> mismatched input '{' expecting GENERATE
{code}

Script1
{code}
register myudf.jar;
A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
B1 = foreach A {
        C = test.TOMAP('key1',$1)#'key1';
        generate C as C;
}
{code}

The above happens when, in a nested foreach i refer to a map key directly from 
a udf result

The same would work if one executes without the nested foreach.
{code}
register myudf.jar;
A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
B1 = foreach A generate test.TOMAP('key1',$1)#'key1';
dump B1;
{code}

Script1 works well with 0.8.


  was:

The below script when executed with version 0.9 fails with parsing error.

{code}
 ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. 
<line 2, column 15> mismatched input '{' expecting GENERATE
{code}

Script1
{code}
register myudf.jar;
A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
B1 = foreach A {
        C = test.TOMAP('key1',$1)#'key1';
        generate C as C;
}
{code}

The above happens when, in a nested foreach i refer to a map key directly from 
a udf result

The same would work if one executes without the nested foreach.
{code}
register myudf.jar;
A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
B1 = foreach A generate test.TOMAP('key1',$1)#'key1';
dump B1;
{code}

Script1 works well with 0.8.


    Fix Version/s: 0.9.0
         Assignee: Xuefu Zhang

> Parsing error when map key referred directly from udf in nested foreach 
> ------------------------------------------------------------------------
>
>                 Key: PIG-2007
>                 URL: https://issues.apache.org/jira/browse/PIG-2007
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Anitha Raju
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>
> The below script when executed with version 0.9 fails with parsing error.
> {code}
>  ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. 
> <line 2, column 15> mismatched input '{' expecting GENERATE
> {code}
> Script1
> {code}
> register myudf.jar;
> A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
> B1 = foreach A {
>         C = test.TOMAP('key1',$1)#'key1';
>         generate C as C;
> }
> {code}
> The above happens when, in a nested foreach i refer to a map key directly 
> from a udf result
> The same would work if one executes without the nested foreach.
> {code}
> register myudf.jar;
> A = load 'test.txt' using PigStorage() as (a:int,b:chararray);
> B1 = foreach A generate test.TOMAP('key1',$1)#'key1';
> dump B1;
> {code}
> Script1 works well with 0.8.

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

Reply via email to