Sergey created PIG-3418:
---------------------------

             Summary: ; in constant breaks parsing
                 Key: PIG-3418
                 URL: https://issues.apache.org/jira/browse/PIG-3418
             Project: Pig
          Issue Type: Bug
          Components: parser
            Reporter: Sergey
            Priority: Blocker
             Fix For: 0.11


Hi. 
1. If you use ; in pig script it breaks parsing
2. It's impossible to pass ; as a value for parameter. Pig starts grunt and 
doesn't start script.

Here is example:
{code}
A = LOAD 'myFile';
B = FOREACH A GENERATE ( host == ';' ? 1 : 0); --line #5
{code}

Here is stacktrace:
{code}
Pig Stack Trace
---------------
ERROR 1200: <file test.pig, line 5, column 0>  mismatched character '<EOF>' 
expecting '''

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during 
parsing. <file test.pig, line 5, column 0>  mismatched character '<EOF>' 
expecting '''
        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1608)
        at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1547)
        at org.apache.pig.PigServer.registerQuery(PigServer.java:518)
        at 
org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:991)
        at 
org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:412)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.j
ava:194)
        at 
org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:170)
        at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
        at org.apache.pig.Main.run(Main.java:604)
        at org.apache.pig.Main.main(Main.java:157)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
Caused by: Failed to parse: <file test.pig, line 5, column 0>  mismatched 
character '<EOF>' expecting '''
        at 
org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:237)
        at 
org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:177)
        at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1600)
        ... 14 more                
{code}
This also would not run.
{code}
pig -p param=; some_pig_script.pig
{code}
grunt would be launched.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to