Description
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:
A = LOAD 'myFile'; B = FOREACH A GENERATE ( host == ';' ? 1 : 0); --line #5
Here is stacktrace:
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
This also would not run.
pig -p param=; some_pig_script.pig
grunt would be launched.
Attachments
Issue Links
- duplicates
-
PIG-2507 Semicolon in parameters for UDF results in parsing error
- Closed