Yes it is. I tried with pig 0.16 on local and it work's.
Corentin Corentin Brémard Data Scientist +33 (0)6 82 74 16 18 [email protected] | www.advalo.com <http://www.advalo.com/> [image: Twitter - Advalo] <https://twitter.com/advalofrance> [image: LinkedIn - Advalo] <https://www.linkedin.com/company/3812160> 2016-08-08 21:58 GMT+02:00 Koji Noguchi <[email protected]>: > Could be https://issues.apache.org/jira/browse/PIG-4889 > > Can you try it with pig 0.16? > Koji > > On Mon, Aug 8, 2016, 3:55:36 PM, Corentin <[email protected]> wrote:Hi, > I found a work around for pig 0.15. Just add a space to the end of string > and use function TRIM(). > Try this: > a = load 'test1.txt' using PigStorage(',') as (A:chararray,B:chararray,C: > chararray); > dump a; > b = foreach a generate 'abcd\\\\abcd'; > dump b; > c = foreach a generate TRIM('abcd\\\\ ’); > dump c; > > From: Christopher Maier > Sent: Friday, October 23, 2015 11:39 AM > To: '[email protected]' <[email protected]> > Cc: Arnaud Balat <[email protected]> > Subject: Backslash at end of string literal > > Hi, > > Pig seems not to handle backslashes at the end of string literals > properly. I've tried several > variations and haven't gotten it to work. Backslashes inside of string > literals still work > fine. Can someone confirm this, or what the correct syntax would be for a > string literal ending > in a backslash? > > SCRIPT > > tgzk9r9@wrnidvmedg001:/data/commonScripts/util/Omniture/pigscripts> cat > test2.pig > a = load 'test1.txt' using PigStorage(',') as (A:chararray,B:chararray,C: > chararray); > dump a; > b = foreach a generate 'abcd\\\\abcd'; > dump b; > c = foreach a generate 'abcd\\\\'; > dump c; > > ERROR > > tgzk9r9@wrnidvmedg001:/data/commonScripts/util/Omniture/pigscripts> pig > -f test2.pig > INFO [JobControl] org.apache.hadoop.mapreduce.lib.input.FileInputFormat > - Total input > paths to process : 1 > INFO [main] org.apache.hadoop.mapreduce.lib.input.FileInputFormat - > Total input paths > to process : 1 > (a,b,c) > INFO [JobControl] org.apache.hadoop.mapreduce.lib.input.FileInputFormat > - Total input > paths to process : 1 > INFO [main] org.apache.hadoop.mapreduce.lib.input.FileInputFormat - > Total input paths > to process : 1 > (abcd\\abcd) > ERROR [main] org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error > during parsing. > Lexical error at line 7, column 0. Encountered: <EOF> after : "" > Details at logfile: /data/commonScripts/util/Omniture/pigscripts/pig_ > 1445618087248.log > > STACK TRACE > > tgzk9r9@wrnidvmedg001:/data/commonScripts/util/Omniture/pigscripts> cat > /data/commonScripts/util/Omniture/pigscripts/pig_1445618087248.log > Pig Stack Trace > --------------- > ERROR 1000: Error during parsing. Lexical error at line 7, column 0. > Encountered: <EOF> > after : "" > > org.apache.pig.tools.pigscript.parser.TokenMgrError: Lexical error at > line 7, column 0. Encountered: > <EOF> after : "" > at org.apache.pig.tools.pigscript.parser. > PigScriptParserTokenManager.getNextToken(PigScriptParserTokenManager. > java:3318) > at org.apache.pig.tools.pigscript.parser.PigScriptParser.jj_ntk( > PigScriptParser.java:1379) > at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse( > PigScriptParser.java:106) > at org.apache.pig.tools.grunt.GruntParser.parseStopOnError( > GruntParser.java:198) > at org.apache.pig.tools.grunt.GruntParser.parseStopOnError( > GruntParser.java:173) > at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84) > at org.apache.pig.Main.run(Main.java:478) > at org.apache.pig.Main.main(Main.java:156) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:94) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:55) > at java.lang.reflect.Method.invoke(Method.java:619) > at org.apache.hadoop.util.RunJar.main(RunJar.java:212) > ============================================================ > ==================== > > PIG VERSION > > tgzk9r9@wrnidvmedg001:/data/commonScripts/util/Omniture/pigscripts> pig > -version > Apache Pig version 0.12.0 (rexported) > compiled Oct 26 2014, 23:43:04 > > Thanks, > Kit >
