I am running my Pigscript in Local mode in eclipse.
when I try to store the output in JsonStorage.
Exception in thread "main" java.lang.RuntimeException: Cannot
> instantiate:org.apache.pig.builtin.JsonStorage
> at
> org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:473)
> at
> org.apache.pig.impl.logicalLayer.parser.QueryParser.NonEvalFuncSpec(QueryParser.java:4976)
> at
> org.apache.pig.impl.logicalLayer.parser.QueryParser.StoreClause(QueryParser.java:3473)
> at
> org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:1351)
> at
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:893)
> at
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:706)
> at
> org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:63)
> at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1017)
> at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:967)
> at org.apache.pig.PigServer.registerQuery(PigServer.java:383)
> at
> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:716)
> at
> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:324)
> at
> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
> at org.apache.pig.PigServer.registerScript(PigServer.java:407)
> at com.paypal.debugpig.DebugPig.main(DebugPig.java:13)
> Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR
> 1070: Could not resolve org.apache.pig.builtin.JsonStorage using imports:
> [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
> at
> org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:458)
> at
> org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:470)
> ... 14 more
PigScript :
REGISTER C:/path/to/jar/pig.jar;
> REGISTER C:/path/to/jar/UpperUDf/UpperUDf_fat.jar;
>
> A = LOAD 'C:/path/to/data/file/student.txt' using PigStorage('\t') AS
> (name: chararray, age: int, gpa: float);
> B = FOREACH A GENERATE myudfs.UPPER(name) ,age, gpa ;
>
> Store B into 'output_student_Json' using
> org.apache.pig.builtin.JsonStorage();
when I dump or store the ouput in text file its working and but issues
occurs when I try to store in JSON format.
Any pointers appreciated
Thank you