Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # user - some pig commands failed when including xml spacial characters


Copy link to this message
-
some pig commands failed when including xml spacial characters
lulynn_2008 2012-08-21, 06:26
Hi all,
I am testing whether pig can purse the commands which contains xml characters. Seems pig can purse the ones including ">", "<", "#" and "&". But can not purse the ones including " ' " and " " ". Following commands failed. Please correct me if I was using the commands in wrong way.
./pig -param SCRIPT="\"a = load 'data0' as (x:chararray); b = filter a by x == '''; store b into 'test1';\"" test.pig
./pig -param SCRIPT="\"a = load 'data0' as (x:chararray); b = filter a by x == '"'; store b into 'test1';\"" test.pig
cat data0:
/
?
#
&
$
>
<
'
"
ERROR 1000: Error during parsing. Lexical error at line 2, column 0.  Encountered: <EOF> after : ""
org.apache.pig.tools.pigscript.parser.TokenMgrError: Lexical error at line 2, column 0.  Encountered: <EOF> after : ""
        at org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager.getNextToken(PigScriptParserTokenManager.java:3123)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.jj_ntk(PigScriptParser.java:1072)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:98)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165)
        at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
        at org.apache.pig.Main.run(Main.java:555)
        at org.apache.pig.Main.main(Main.java:111)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
===============================================================================