You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Richard Ding (JIRA)" <ji...@apache.org> on 2011/05/05 19:07:03 UTC
[jira] [Resolved] (PIG-1999) Macro alias masker should consider
schema context
[ https://issues.apache.org/jira/browse/PIG-1999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard Ding resolved PIG-1999.
-------------------------------
Resolution: Fixed
Hadoop Flags: [Reviewed]
Unit tests pass. Patch committed to trunk and 0.9 branch.
> Macro alias masker should consider schema context
> --------------------------------------------------
>
> Key: PIG-1999
> URL: https://issues.apache.org/jira/browse/PIG-1999
> Project: Pig
> Issue Type: Bug
> Components: impl
> Affects Versions: 0.9.0
> Reporter: Richard Ding
> Assignee: Richard Ding
> Fix For: 0.9.0
>
> Attachments: PIG-1999_1.patch, PIG-1999_2.patch
>
>
> Macro alias masker doesn't consider the current schema context. This results errors when deciding with alias to mask. Here is an example:
> {code}
> define toBytearray(in, intermediate) returns e {
> a = load '$in' as (name:chararray, age:long, gpa: float);
> b = group a by name;
> c = foreach b generate a, (1,2,3);
> store c into '$intermediate' using BinStorage();
> d = load '$intermediate' using BinStorage() as (b:bag{t:tuple(x,y,z)}, t2:tuple(a,b,c));
> $e = foreach d generate COUNT(b), t2.a, t2.b, t2.c;
> };
>
> f = toBytearray ('data', 'output1');
> {code}
> Now the alias masker mistakes b in COUNT(b) as an alias instead of b in the current schema.
> The workaround is to not use alias as as names in the schema definition.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira