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

Grunt parser doesn't handle escape codes correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • grunt
    • None
    • Pig Trunk 01-Aug-2008
      Hadoop 17.1
      Linux Ubuntu

    Description

      Grunt parser doesn't handle escape codes correctly such as \s \n
      ..

      Exemple, using:
      raw_filtered = FILTER raw BY ngram matches '^[a-zA-Z0-9\s]$';
      OR
      raw_filtered = FILTER raw BY ngram matches "^[a-zA-Z0-9\s]$";

      I get the following error:

      org.apache.pig.impl.logicalLayer.parser.TokenMgrError: Lexical error at line 1, column 57. Encountered: "s" (115), after : "\'^[a-zA-Z0-9
      "
      at org.apache.pig.impl.logicalLayer.parser.QueryParserTokenManager.getNextToken(QueryParserTokenManager.java:1623)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.jj_consume_token(QueryParser.java:4744)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.PUnaryCond(QueryParser.java:1117)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.PAndCond(QueryParser.java:1055)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.POrCond(QueryParser.java:1005)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.PCond(QueryParser.java:973)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.FilterClause(QueryParser.java:941)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:686)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:512)
      at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:362)
      at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47)
      at org.apache.pig.PigServer.registerQuery(PigServer.java:275)
      at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:475)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:233)
      at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:81)
      at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:60)
      at org.apache.pig.Main.main(Main.java:294)

      Attachments

        Issue Links

          Activity

            People

              xuefuz Xuefu Zhang
              rturk Rafael Turk
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: