Hi pig !
Should JsonStorage support every type of store() that PigStorage supports?
It appears that it breaks in a clear case where PigStorage works... here
are the details.
I'm able to serialize one of my datasets using PigStorage, but not
JsonStorage.
<<<< THIS WORKS >>>>
*1) pigServer.store("uniqcnt", "/tmp/bbb1", "PigStorage");*
results in this file:
>cat /tmp/bbb
storeCode_AK 4
storeCode_AZ 2
storeCode_CO 7
storeCode_CT 4
storeCode_OK 2
<<<< THIS FAILS >>>>
*2) pigServer.store("uniqcnt", "/tmp/bbb2", "JsonStorage");*
Results in a stacktrace :
When I try with JSonStorage:
Failed to parse: <line 1, column 6> Syntax error, unexpected symbol at or
near ','
at
org.apache.pig.parser.QueryParserDriver.parseSchema(QueryParserDriver.java:94)
at
org.apache.pig.parser.QueryParserDriver.parseSchema(QueryParserDriver.java:108)
at org.apache.pig.impl.util.Utils.parseSchema(Utils.java:208)
at org.apache.pig.impl.util.Utils.getSchemaFromString(Utils.java:182)
at
org.apache.pig.builtin.JsonStorage.prepareToWrite(JsonStorage.java:140)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat$PigRecordWriter.<init>(PigOutputFormat.java:125)
at
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getRecordWriter(PigOutputFormat.java:86)
at
org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:553)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:408)
at
org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:216)