You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2013/10/02 21:47:44 UTC

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

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

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

    Attachment: PIG-2315-1.patch

Attach a patch to fix the issue by adding a cast only foreach below:

A1 = foreach A1 generate a as a:chararray;
=>
A1 = foreach A1 generate a;
A1 = foreach A1 generate (chararray)a;

b = foreach a generate flatten(nb) as (year, name:chararray);
=>
b = foreach a generate flatten(nb) as (year, name);
b = foreach b generate year, (chararray)name;

vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as (ts:chararray, runTime:double, cpuTime:double);
=> vLogFields = FOREACH vLogs GENERATE FLATTEN(LFV(TOTUPLE(*), ('timestamp', 'runTime', 'cpuTime'))) as (ts, runTime, cpuTime);
vLogFields = FOREACH vLogFields GENERATE (chararray)ts, (double)runTime, (double)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
>             Fix For: 0.12.0
>
>         Attachments: PIG-2315-1.patch
>
>
> 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 was sent by Atlassian JIRA
(v6.1#6144)