hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olga Natkovich (JIRA)" <j...@apache.org>
Subject [jira] Updated: (PIG-394) Syntax for ?: requires parens in FOREACH
Date Fri, 09 Jul 2010 18:50:49 GMT

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

Olga Natkovich updated PIG-394:
-------------------------------

    Fix Version/s: 0.9.0
      Description: 
This fails

clean = FOREACH log {
    ev = eventType eq '/rate/video'?'none':eventType;
    GENERATE ev as event, 1 as cnt;
}


but this works

clean = FOREACH log {
    ev = (eventType eq '/rate/video'?'none':eventType);
    GENERATE ev as event, 1 as cnt;
}

The requirement for parens is bogus.  Also, this fails with very misleading messages:

clean = FOREACH log {
    ev = (eventType eq '/rate/video')?'none':eventType;
    GENERATE ev as event, 1 as cnt;
}

I think that the parser needs to be completely revamped to avoid this sort of strangeness.

  was:

This fails

clean = FOREACH log {
    ev = eventType eq '/rate/video'?'none':eventType;
    GENERATE ev as event, 1 as cnt;
}


but this works

clean = FOREACH log {
    ev = (eventType eq '/rate/video'?'none':eventType);
    GENERATE ev as event, 1 as cnt;
}

The requirement for parens is bogus.  Also, this fails with very misleading messages:

clean = FOREACH log {
    ev = (eventType eq '/rate/video')?'none':eventType;
    GENERATE ev as event, 1 as cnt;
}

I think that the parser needs to be completely revamped to avoid this sort of strangeness.


> Syntax for ?: requires parens in FOREACH
> ----------------------------------------
>
>                 Key: PIG-394
>                 URL: https://issues.apache.org/jira/browse/PIG-394
>             Project: Pig
>          Issue Type: Bug
>          Components: grunt
>    Affects Versions: 0.1.0
>            Reporter: Ted Dunning
>             Fix For: 0.9.0
>
>
> This fails
> clean = FOREACH log {
>     ev = eventType eq '/rate/video'?'none':eventType;
>     GENERATE ev as event, 1 as cnt;
> }
> but this works
> clean = FOREACH log {
>     ev = (eventType eq '/rate/video'?'none':eventType);
>     GENERATE ev as event, 1 as cnt;
> }
> The requirement for parens is bogus.  Also, this fails with very misleading messages:
> clean = FOREACH log {
>     ev = (eventType eq '/rate/video')?'none':eventType;
>     GENERATE ev as event, 1 as cnt;
> }
> I think that the parser needs to be completely revamped to avoid this sort of strangeness.

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


Mime
View raw message