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

Passing semicolon as a parameter in UDF causes parser error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.9.1, 0.10.0
    • None
    • grunt
    • None

    Description

      Pig script, which uses a UDF loads in 3 chararray columns, and then concatenates columns 2 and 3 using a semicolon.

      register CONCATSEP.jar;
      A = LOAD 'someinput/*' USING PigStorage(';') as (col1:chararray,col2:chararray,col3:chararray);
      B = FOREACH A GENERATE col1, string.CONCATSEP(';',col2,col3) as newcol;
      STORE B INTO 'someoutput' USING PigStorage(';');
      

      The following script causes an error during the parsing stage due to the semicolon present in the UDF.
      =================================================================================
      2009-03-24 15:50:56,454 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Lexical error at line 3, column 49. Encountered: <EOF> after : "\';"
      Details at logfile: /homes/viraj/pig-svn/trunk/pig_1237935055635.log
      =================================================================================

      There is no workaround for the same, expect to hardcode this in the UDF.

      Attachments

        1. semicolonerr.pig
          0.2 kB
          Viraj Bhat
        2. CONCATSEP.jar
          3 kB
          Viraj Bhat

        Issue Links

          Activity

            People

              Unassigned Unassigned
              viraj Viraj Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: