Created 06-11-2016 08:27 AM
hi:
can do this: i am receiving this error
(chararray) ( (COD_LINEA =='01' and ID_GRP_PD='11') OR (COD_LINEA =='01' and ID_GRP_PD='13') OR (COD_LINEA =='01' and ID_GRP_PD='21') ? 'CM' : ( (COD_LINEA =='01' and ID_GRP_PD='31') OR (COD_LINEA =='01' and ID_GRP_PD='32') OR (COD_LINEA =='01' and ID_GRP_PD='33') ? 'INGs' : ( (COD_LINEA =='01' and ID_GRP_PD='34') OR (COD_LINEA =='01' and ID_GRP_PD='35') OR (COD_LINEA =='01' and ID_GRP_PD='36') ? 'AXT' : ''))) as PROD;
2016-06-11 10:28:40,658 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Lexical error at line 79, column 9. Encountered: "(" (40), after : "" 2016-06-11 10:28:40,658 [main] ERROR org.apache.pig.tools.grunt.Grunt - org.apache.pig.tools.pigscript.parser.TokenMgrError: Lexical error at line 79, column 9. Encountered: "(" (40), after : "" at org.apache.pig.tools.pigscript.parser.PigScriptParserTokenManager.getNextToken(PigScriptParserTokenManager.java:3370) at org.apache.pig.tools.pigscript.parser.PigScriptParser.jj_ntk(PigScriptParser.java:1449) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:110) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:230) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:205) at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81) at org.apache.pig.Main.run(Main.java:631) at org.apache.pig.Main.main(Main.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Created 06-12-2016 04:40 PM
Hi:
I fixed it like this:
B = FOREACH A GENERATE (chararray) (($3 =='01' AND $4=='11') OR ($3 =='01' AND $4=='13') OR ($3 =='01' AND $4=='21') ? 'CM' : '' )
Created 06-12-2016 02:46 AM
Hmm, what are you trying to do, I get the same parsing error
Created 06-12-2016 04:40 PM
Hi:
I fixed it like this:
B = FOREACH A GENERATE (chararray) (($3 =='01' AND $4=='11') OR ($3 =='01' AND $4=='13') OR ($3 =='01' AND $4=='21') ? 'CM' : '' )