You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Xuefu Zhang (JIRA)" <ji...@apache.org> on 2011/03/15 18:53:30 UTC

[jira] Commented: (PIG-731) Passing semicolon as a parameter in UDF causes parser error

    [ https://issues.apache.org/jira/browse/PIG-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007047#comment-13007047 ] 

Xuefu Zhang commented on PIG-731:
---------------------------------

The problem seems being caused by PigScriptParser, which interprets the ; in ';' as the end of Pig statement. As a result, it passes only partial pig statement to the QueryPaser.

It's suggested that the problem be addressed when PigScriptParser is replaced.

> Passing semicolon as a parameter in UDF causes parser error 
> ------------------------------------------------------------
>
>                 Key: PIG-731
>                 URL: https://issues.apache.org/jira/browse/PIG-731
>             Project: Pig
>          Issue Type: Bug
>          Components: grunt
>    Affects Versions: 0.3.0
>            Reporter: Viraj Bhat
>            Assignee: Xuefu Zhang
>             Fix For: 0.9.0
>
>         Attachments: CONCATSEP.jar, semicolonerr.pig
>
>
> Pig script, which uses a UDF  loads in 3 chararray columns, and then concatenates columns 2 and 3 using a semicolon.
> {code}
> 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(';');
> {code}
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira