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

Line number off when reporting syntax error inside a macro

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.16.0
    • parser
    • None
    • Reviewed

    Description

      1 /*
      2 * extra lines to offset the line number for the macro
      3 *
      4 *
      5 */
      6
      7
      8 define mymacro() returns void {
      9 A = load 'x' as ( u:int, v:long, w:bytearray);
      10 B = limit A 100;
      11 C = filter_typo B by 2 > 1;
      12 D = load 'y' as (d1, d2);
      13 E = join C by ( $0, $1 ), D by ( d1, d2 ) using 'replicated' parallel 16;
      14 F = store E into 'output';
      15 };
      16 mymacro();

      This fails with

      "2016-05-05 22:25:28,390 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: <file test.pig, line 16> Failed to parse macro 'mymacro'. Reason: <file /homes/knoguchi/test.pig, line 4, column 0> Syntax error, unexpected symbol at or near 'C'"

      test.pig, line 4, should have been line 11.

      Attachments

        1. pig-4888-v01.patch
          3 kB
          Koji Noguchi

        Activity

          People

            knoguchi Koji Noguchi
            knoguchi Koji Noguchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: