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

failed to parse simple macro

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 0.9.2, 0.10.0
    • None
    • None
    • None

    Description

      define test(in ) returns B {
      A = load '$in' using PigStorage() as (name:chararray, age:int, gpa:double);
      $B = load '$in' using PigStorage() as (name, age, gpa);
      describe A;
      }
      X = test('/user/user1/pig/tests/data/singlefile/studenttab10k');

      Pig Stack Trace
      ---------------
      ERROR 1200: <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 7> Failed to parse macro 'test'. Reason: <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 4, column 12> Syntax error, unexpected symbol at or near 'A'
      macro content:
      A = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name:chararray, age:int, gpa:double);
      X = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age, gpa);
      describe A;

      org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 7> Failed to parse macro 'test'. Reason: <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 4, column 12> Syntax error, unexpected symbol at or near 'A'
      macro content:
      A = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name:chararray, age:int, gpa:double);
      X = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age, gpa);
      describe A;

      at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1639)
      at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1584)
      at org.apache.pig.PigServer.registerQuery(PigServer.java:584)
      at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:942)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:188)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:164)
      at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81)
      at org.apache.pig.Main.run(Main.java:561)
      at org.apache.pig.Main.main(Main.java:111)
      Caused by: Failed to parse: <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 7> Failed to parse macro 'test'. Reason: <file /grid/2/dev/pigqa/out/pigtest/user1/user1.1321116151/Macro_Negative_24.pig, line 4, column 12> Syntax error, unexpected symbol at or near 'A'
      macro content:
      A = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name:chararray, age:int, gpa:double);
      X = load '/user/user1/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age, gpa);
      describe A;

      at org.apache.pig.parser.PigMacro.maskAlias(PigMacro.java:201)
      at org.apache.pig.parser.PigMacro.inline(PigMacro.java:101)
      at org.apache.pig.parser.PigMacro.macroInline(PigMacro.java:456)
      at org.apache.pig.parser.QueryParserDriver.inlineMacro(QueryParserDriver.java:279)
      at org.apache.pig.parser.QueryParserDriver.expandMacro(QueryParserDriver.java:268)
      at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:165)
      at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1631)
      ... 9 more
      ================================================================================

      Attachments

        Activity

          People

            Unassigned Unassigned
            araceli Araceli Henley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: