You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Santhosh Srinivasan (JIRA)" <ji...@apache.org> on 2008/09/18 02:03:44 UTC
[jira] Created: (PIG-436) When a single column is flattened, the
alias is lost in subsequent statements that refer to the alias
When a single column is flattened, the alias is lost in subsequent statements that refer to the alias
-----------------------------------------------------------------------------------------------------
Key: PIG-436
URL: https://issues.apache.org/jira/browse/PIG-436
Project: Pig
Issue Type: Bug
Affects Versions: types_branch
Reporter: Santhosh Srinivasan
Assignee: Pradeep Kamath
Fix For: types_branch
When a single column is flattened, the front end generates aliases that disambiguate the columns in the flattened column. Subsequent statements that refer to this column always need to refer to the unambiguous alias even though there could be no ambiguity. A reproducible use case is given below:
{code}
a = load 'one' as (name, age, gpa);
b = group a by name;
c = foreach b generate flatten(a);
d = foreach c generate name;
e = foreach d generate name;
1971337 [main] ERROR org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Invalid alias: name in {a::name: bytearray}
at org.apache.pig.PigServer.parseQuery(PigServer.java:293)
at org.apache.pig.PigServer.registerQuery(PigServer.java:258)
at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:432)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:242)
at org.apache.pig.tools.grunt.GruntParser.parseContOnError(GruntParser.java:93)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:58)
at org.apache.pig.Main.main(Main.java:282)
Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Invalid alias: name in {a::name: bytearray}
at org.apache.pig.impl.logicalLayer.parser.QueryParser.AliasFieldOrSpec(QueryParser.java:5818)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.ColOrSpec(QueryParser.java:5677)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseEvalSpec(QueryParser.java:3969)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.UnaryExpr(QueryParser.java:3866)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.CastExpr(QueryParser.java:3820)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.MultiplicativeExpr(QueryParser.java:3729)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:3653)
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (PIG-436) When a single column is flattened, the
alias is lost in subsequent statements that refer to the alias
Posted by "Olga Natkovich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olga Natkovich resolved PIG-436.
--------------------------------
Resolution: Fixed
patch committed; thanks, pradeep!
> When a single column is flattened, the alias is lost in subsequent statements that refer to the alias
> -----------------------------------------------------------------------------------------------------
>
> Key: PIG-436
> URL: https://issues.apache.org/jira/browse/PIG-436
> Project: Pig
> Issue Type: Bug
> Affects Versions: types_branch
> Reporter: Santhosh Srinivasan
> Assignee: Pradeep Kamath
> Fix For: types_branch
>
> Attachments: PIG-436.patch
>
>
> When a single column is flattened, the front end generates aliases that disambiguate the columns in the flattened column. Subsequent statements that refer to this column always need to refer to the unambiguous alias even though there could be no ambiguity. A reproducible use case is given below:
> {code}
> a = load 'one' as (name, age, gpa);
> b = group a by name;
> c = foreach b generate flatten(a);
> d = foreach c generate name;
> e = foreach d generate name;
> 1971337 [main] ERROR org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Invalid alias: name in {a::name: bytearray}
> at org.apache.pig.PigServer.parseQuery(PigServer.java:293)
> at org.apache.pig.PigServer.registerQuery(PigServer.java:258)
> at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:432)
> at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:242)
> at org.apache.pig.tools.grunt.GruntParser.parseContOnError(GruntParser.java:93)
> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:58)
> at org.apache.pig.Main.main(Main.java:282)
> Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Invalid alias: name in {a::name: bytearray}
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.AliasFieldOrSpec(QueryParser.java:5818)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.ColOrSpec(QueryParser.java:5677)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseEvalSpec(QueryParser.java:3969)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.UnaryExpr(QueryParser.java:3866)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.CastExpr(QueryParser.java:3820)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.MultiplicativeExpr(QueryParser.java:3729)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:3653)
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PIG-436) When a single column is flattened, the
alias is lost in subsequent statements that refer to the alias
Posted by "Pradeep Kamath (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pradeep Kamath updated PIG-436:
-------------------------------
Attachment: PIG-436.patch
Attached patch to resolve the issue - new unit tests included in the patch
> When a single column is flattened, the alias is lost in subsequent statements that refer to the alias
> -----------------------------------------------------------------------------------------------------
>
> Key: PIG-436
> URL: https://issues.apache.org/jira/browse/PIG-436
> Project: Pig
> Issue Type: Bug
> Affects Versions: types_branch
> Reporter: Santhosh Srinivasan
> Assignee: Pradeep Kamath
> Fix For: types_branch
>
> Attachments: PIG-436.patch
>
>
> When a single column is flattened, the front end generates aliases that disambiguate the columns in the flattened column. Subsequent statements that refer to this column always need to refer to the unambiguous alias even though there could be no ambiguity. A reproducible use case is given below:
> {code}
> a = load 'one' as (name, age, gpa);
> b = group a by name;
> c = foreach b generate flatten(a);
> d = foreach c generate name;
> e = foreach d generate name;
> 1971337 [main] ERROR org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Invalid alias: name in {a::name: bytearray}
> at org.apache.pig.PigServer.parseQuery(PigServer.java:293)
> at org.apache.pig.PigServer.registerQuery(PigServer.java:258)
> at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:432)
> at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:242)
> at org.apache.pig.tools.grunt.GruntParser.parseContOnError(GruntParser.java:93)
> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:58)
> at org.apache.pig.Main.main(Main.java:282)
> Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Invalid alias: name in {a::name: bytearray}
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.AliasFieldOrSpec(QueryParser.java:5818)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.ColOrSpec(QueryParser.java:5677)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseEvalSpec(QueryParser.java:3969)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.UnaryExpr(QueryParser.java:3866)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.CastExpr(QueryParser.java:3820)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.MultiplicativeExpr(QueryParser.java:3729)
> at org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:3653)
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.