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

Search Discussions

  • Pradeep Kamath (JIRA) at Sep 18, 2008 at 6:33 pm
    [ 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.
  • Olga Natkovich (JIRA) at Sep 18, 2008 at 9:37 pm
    [ 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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriespig, hadoop
postedSep 18, '08 at 12:04a
activeSep 18, '08 at 9:37p
posts3
users1
websitepig.apache.org

1 user in discussion

Olga Natkovich (JIRA): 3 posts

People

Translate

site design / logo © 2022 Grokbase