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

Use of eval or any other keyword in the package hierarchy of a UDF causes parse exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.3.0
    • 0.3.0
    • documentation, grunt
    • None
    • Reviewed

    Description

      Consider a Pig script which does something similar to a word count. It uses the built-in TOKENIZE function, but packages it inside a class hierarchy such as "mypackage.eval"

      register TOKENIZE.jar
      my_src  = LOAD '/user/viraj/mywordcount.txt' USING PigStorage('\t')  AS (mlist: chararray);
      modules = FOREACH my_src GENERATE FLATTEN(mypackage.eval.TOKENIZE(mlist));
      describe modules;
      grouped = GROUP modules BY $0;
      describe grouped;
      counts  = FOREACH grouped GENERATE COUNT(modules), group;
      ordered = ORDER counts BY $0;
      dump ordered;
      

      The parser complains:
      ===========================================================================================================================
      2009-02-05 01:17:29,231 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Invalid alias: mypackage in

      {mlist: chararray}

      ===========================================================================================================================

      I looked at the following source code at (src/org/apache/pig/impl/logicalLayer/parser/QueryParser.jjt) and it seems that : EVAL is a keyword in Pig. Here are some clarifications:

      1) Is there documentation on what the EVAL keyword actually is?
      2) Is EVAL keyword actually implemented?

      Viraj

      Attachments

        1. TOKENIZE.jar
          3 kB
          Viraj Bhat
        2. mywordcount.txt
          0.1 kB
          Viraj Bhat
        3. reserved.patch
          3 kB
          Milind Barve
        4. pigusergroup656.patch
          0.8 kB
          Aniket Namadeo Mokashi

        Activity

          People

            milindb Milind Barve
            viraj Viraj Bhat
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: