You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Olga Natkovich (Created) (JIRA)" <ji...@apache.org> on 2011/10/07 02:03:29 UTC

[jira] [Created] (PIG-2315) Make as clause work in generate

Make as clause work in generate
-------------------------------

                 Key: PIG-2315
                 URL: https://issues.apache.org/jira/browse/PIG-2315
             Project: Pig
          Issue Type: Bug
            Reporter: Olga Natkovich


Currently, the following syntax is supported and ignored causing confusing with users:

A1 = foreach A1 generate a as a:chararray ;

After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Gianmarco De Francisci Morales (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151627#comment-13151627 ] 

Gianmarco De Francisci Morales commented on PIG-2315:
-----------------------------------------------------

I assume that as long as you don't cast it to some types this should have no effect on your code.
In your example you are just renaming fields, not casting them.
                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2315) Make as clause work in generate

Posted by "Gianmarco De Francisci Morales (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales updated PIG-2315:
------------------------------------------------

    Fix Version/s:     (was: 0.11)
                   0.12
    
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>             Fix For: 0.12
>
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134274#comment-13134274 ] 

Daniel Dai commented on PIG-2315:
---------------------------------

I had a discussion with Thejas before, we want to perform the "as" cast after we evaluate the generated item:

A1 = foreach A1 generate (int)a as a:chararray;
=> A1 = foreach A1 generate (chararray)((int)a) as a;
                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151442#comment-13151442 ] 

Prashant Kommireddi commented on PIG-2315:
------------------------------------------

How would this work when a Tuple is being mapped using "AS" 

{code}
vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as 
            (ts, runTime, cpuTime);
{code}

Here I call a function LFV which returns a Tuple which is being mapped to {ts, runTime, cpuTime}. 
                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Gianmarco De Francisci Morales (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13133991#comment-13133991 ] 

Gianmarco De Francisci Morales commented on PIG-2315:
-----------------------------------------------------

What is the desired solution?
To make the aforementioned syntax work as a cast or to allow only explicit casting?
E.g.
{code}
A1 = foreach A1 generate (chararray) a;
{code}

                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153049#comment-13153049 ] 

Prashant Kommireddi commented on PIG-2315:
------------------------------------------

Return type of UDF "LFV" is bytearray. The issue here is that when I pass the field "ts" to a MIN function, or "runTime" to a SUM (after a group by) the scripts errors out with a ClassCastException (Cannot convert bytearray to String/Double)
                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (PIG-2315) Make as clause work in generate

Posted by "Gianmarco De Francisci Morales (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gianmarco De Francisci Morales reassigned PIG-2315:
---------------------------------------------------

    Assignee: Gianmarco De Francisci Morales
    
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (PIG-2315) Make as clause work in generate

Posted by "Prashant Kommireddi (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13153048#comment-13153048 ] 

Prashant Kommireddi commented on PIG-2315:
------------------------------------------

Apologies, it should have read 
{code}
vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as 
            (ts:chararray, runTime:double, cpuTime:double);
{code}



                
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (PIG-2315) Make as clause work in generate

Posted by "Daniel Dai (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Dai updated PIG-2315:
----------------------------

    Fix Version/s: 0.11
    
> Make as clause work in generate
> -------------------------------
>
>                 Key: PIG-2315
>                 URL: https://issues.apache.org/jira/browse/PIG-2315
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Olga Natkovich
>            Assignee: Gianmarco De Francisci Morales
>             Fix For: 0.11
>
>
> Currently, the following syntax is supported and ignored causing confusing with users:
> A1 = foreach A1 generate a as a:chararray ;
> After this statement a just retains its previous type

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira