Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-618

Bad error message when period rather than comma appears as separator in UDF parameter list

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.2.0
    • 0.9.0
    • impl
    • None

    Description

      Pig script generates the following compile-time error as it contains a period between 0.8 and 0.9 in the MYUDF parameter list. The "Invalid alias MYUDF" message should be changed to something that is more meaningful for the user to trace.

      register 'MYUDF.jar';
      A = load 'mydata.txt' using PigStorage() as (
              col1:   int,
              col2:   chararray,
              col3:   long,
              col4:   int
              );
      
      B =  group A by (
              col1,
              col2
              );
      
      C = foreach B generate
              group,
              MYUDF(A.col3, 0.0, 0.8. 0.9) as stat: (min, max);
      describe C;
      

      ========================================================================================================
      java.io.IOException: Invalid alias: MYUDF in {group: (col1: int,col2: chararray),A: {col1: int,col2: chararray,col
      3: long,col4: int}}
      at org.apache.pig.PigServer.parseQuery(PigServer.java:301)
      at org.apache.pig.PigServer.registerQuery(PigServer.java:266)
      at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:439)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:249)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:84)
      at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:64)
      at org.apache.pig.Main.main(Main.java:306)
      Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Invalid alias: MYUDF in {group: (col1: int,col2
      : chararray),A: {col1: int,col2: chararray,col3: long,col4: int}}
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.AliasFieldOrSpec(QueryParser.java:6005)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.ColOrSpec(QueryParser.java:5863)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseEvalSpec(QueryParser.java:4049)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.UnaryExpr(QueryParser.java:3946)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.CastExpr(QueryParser.java:3900)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.MultiplicativeExpr(QueryParser.java:3809)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:3735)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.InfixExpr(QueryParser.java:3701)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.FlattenedGenerateItem(QueryParser.java:3627)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.FlattenedGenerateItemList(QueryParser.java:3550)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.GenerateStatement(QueryParser.java:3494)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedBlock(QueryParser.java:2969)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.ForEachClause(QueryParser.java:2384)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:1019)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:795)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:590)
      at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:60)
      at org.apache.pig.PigServer.parseQuery(PigServer.java:298)
      ========================================================================================================

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            xuefuz Xuefu Zhang
            viraj Viraj Bhat
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment