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

Santhosh Srinivasan updated PIG-426:
------------------------------------

    Attachment: PIG-426.patch

Patch (PIG-426.patch) addresses the following:

1. Parser fix to compute if a type is atomic or not.
2. Logical expression operators allow multiple outputs. This was preventing the 
graph construction inside the foreach where expression assignments were reused.

All unit test cases pass.

> Adding result of two UDFs gives a syntax error
> ----------------------------------------------
>
>                 Key: PIG-426
>                 URL: https://issues.apache.org/jira/browse/PIG-426
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: types_branch
>            Reporter: Alan Gates
>            Assignee: Santhosh Srinivasan
>             Fix For: types_branch
>
>         Attachments: PIG-426.patch
>
>
> A script like:
> {code}
> a = load 'studenttab10k' using PigStorage() as (name, age, gpa);
> b = load 'votertab10k' as (name, age, registration, contributions);
> c = cogroup a by name, b by name;
> d = foreach c generate flatten(group), COUNT(a) + COUNT(b);
> store d into 'output';
> {code}
> gives
> {code}
> java.io.IOException: Atomic field expected but found non-atomic field
>     at org.apache.pig.PigServer.registerQuery(PigServer.java:276)
>     at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:432)
>     at 
> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:83)
>     at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:64)
>     at org.apache.pig.Main.main(Main.java:306)
> Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Atomic 
> field expected but found non-atomic field
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.assertAtomic(QueryParser.java:262)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:3671)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.InfixExpr(QueryParser.java:3612)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.FlattenedGenerateItem(QueryParser.java:3538)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.FlattenedGenerateItemList(QueryParser.java:3472)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.GenerateStatement(QueryParser.java:3416)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedBlock(QueryParser.java:2902)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.ForEachClause(QueryParser.java:2305)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:956)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:731)
>     at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:532)
>     at 
> org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:60)
>     at org.apache.pig.PigServer.registerQuery(PigServer.java:273)
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to