Pig
  1. Pig
  2. PIG-583

Bag constants used in non foreach statements cause lexical errors

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.2.0
    • Fix Version/s: None
    • Component/s: grunt
    • Labels:
      None

      Description

      Use of bag constants in non-foreach statement cause lexical errors in Pig. The root cause is the inability of grunt to distinguish between nested block and bag constant in non-foreach statements.

      grunt> a = load 'input'; 
      grunt> b = filter a by ($0 eq {(1)});
      
      2008-12-29 14:12:15,306 [main] ERROR org.apache.pig.tools.grunt.GruntParser - java.io.IOException: Encountered " <FILTEROP> "eq "" at line 1, column 21.
      Was expecting one of:
          "*" ...
          ")" ...
          "." ...
          "+" ...
          "-" ...
          "/" ...
          "%" ...
          "#" ...
      ...
      org.apache.pig.tools.pigscript.parser.TokenMgrError: Lexical error at line 2, column 29.  Encountered: ")" (41), after : ""
              at org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager.getNextToken(PigScriptParserTokenManager.java:2608)
              at org.apache.pig.tools.pigscript.parser.PigScriptParser.jj_ntk(PigScriptParser.java:658)
              at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:84)
              at org.apache.pig.tools.grunt.GruntParser.parseContOnError(GruntParser.java:94)
              at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:58)
              at org.apache.pig.Main.main(Main.java:282)
      
      

        Issue Links

          Activity

            People

            • Assignee:
              Xuefu Zhang
              Reporter:
              Santhosh Srinivasan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development