[ 
https://issues.apache.org/jira/browse/PIG-159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598291#action_12598291
 ] 

Pi Song commented on PIG-159:
-----------------------------


3. Sorry I really missed one line when copying and paste. Here is the query:-
{noformat}
a = load 'a' as (field1: integer, field2: long);
b = load 'a' as (field1: bytearray, field2: double);
c = group a by field1, b by field1  ;
d = foreach c generate b.field2, flattten(a)  ;
{noformat}
Maybe it thinks flatten is a UDF

4. Thanks for clarification

6. Possibly the logic is "if there is a comma in between brackets, it's a 
tuple". 

Though seems there is no good way to handle single-element tuples.
{noformat}
X = (5) ;
{noformat}
In this case it's hard to tell if (5) is atomic  or  tuple. The pythonic way is 
(5,) means it's a single-element tuple. We might end up the same way?

> Make changes to the parser to support new types functionality
> -------------------------------------------------------------
>
>                 Key: PIG-159
>                 URL: https://issues.apache.org/jira/browse/PIG-159
>             Project: Pig
>          Issue Type: Sub-task
>          Components: impl
>            Reporter: Alan Gates
>            Assignee: Alan Gates
>         Attachments: parser_chages_v5.patch, parser_chages_v6.patch, 
> parser_chages_v7.patch, parser_chages_v8.patch, parser_chages_v9.patch
>
>
> In order to support the new types functionality described in 
> http://wiki.apache.org/pig/PigTypesFunctionalSpec, the parse needs to change 
> in the following ways:
> 1) AS needs to support types in addition to aliases.  So where previously it 
> was legal to say:
> a = load 'myfile' as a, b, c;
> it will now also be legal to say
> a = load 'myfile' as a integer, b float, c chararray;
> 2) Non string constants need to be supported.  This includes non-string 
> atomic types (integer, long, float, double) and the non-atomic types bags, 
> tuples, and maps.
> 3) A cast operator needs to be added so that fields can be explicitly casted.
> 4) Changes to DEFINE, to allow users to declare arguments and return types 
> for UDFs

-- 
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