Pig
  1. Pig
  2. PIG-1908

display the contents of line and indicate the position of the erroneous token for syntax errors

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      With latest version of the parser, the line number and position of the erroneous token are displayed.

      For example -

      > cat err.pig
      l = load 'x' ;
      f1 = foreach l generate $1, $2, $3, $4 + $3, $5 $3;
      dump f1;
      
      > pig -x local       err.pig
      2011-03-15 11:06:06,563 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. line 2:48 mismatched input ['$3'] expecting SEMI_COLON
      

      It will be easier for to identify the reason for syntax error if the message also prints the line contents and indicates the position. This is specially useful if the script and/or line is long.
      For example, the error message could be -

      2011-03-15 11:06:06,563 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. line 2:48 mismatched input ['$3'] expecting SEMI_COLON
      f1 = foreach l generate $1, $2, $3, $4 + $3, $5 $3;
                                                      ^ 
      

        Activity

        Hide
        Xuefu Zhang added a comment -

        This appears to be a new feature, and would be a good candidate for next release.

        Show
        Xuefu Zhang added a comment - This appears to be a new feature, and would be a good candidate for next release.

          People

          • Assignee:
            Xuefu Zhang
            Reporter:
            Thejas M Nair
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development