[
https://issues.apache.org/jira/browse/PIG-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12994942#comment-12994942
]
Xuefu Zhang commented on PIG-1765:
----------------------------------
The issue about foreach generate a as aa:int vs (aa:int) was once there but
quickly addressed. Right now, we have exactly the same behavior as the old
parser.
In addition, B = foreach A generate (A.x); doesn't parse in the new parser, but
parses in the old one. I think it should be invalid because A is used both as a
relation as well as a scalar. If A has only one row, B = foreach A generate x
will give the same result.
We can deprecate A = load 'foo' as x:int; in the new parser.
> as_clause in foreach statement should differentiate between simple type and
> type within tuple
> ---------------------------------------------------------------------------------------------
>
> Key: PIG-1765
> URL: https://issues.apache.org/jira/browse/PIG-1765
> Project: Pig
> Issue Type: Sub-task
> Reporter: Thejas M Nair
> Assignee: Xuefu Zhang
> Fix For: 0.9.0
>
>
> In new parser changes, the following statements are treated as same -
> f = foreach l generate a as aa :int; -- here the column is now called aa
> and has type int
> f = foreach l generate a as (aa :int); -- this should mean that the column
> has type "tuple with column aa of type int"
> With old parser the 2nd statement results in syntax error, which is fine,
> because it requires name part .
> The parenthesis represent tuple in pig. We should deprecate support for load
> statement that takes schema without the parenthesis part , such as following
> example -
> l = load 'x' as a:int -- It should be as (a :int) , it is treated as such but
> this is inconsistent syntax.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira