Pig code:
raw = LOAD '/user/nidhi/piped-data'
USING PigStorage('|') AS
(Device_Type:chararray,
Event_Id:chararray,
JSON_Series:chararray);
parsed = FOREACH raw GENERATE Device_Type, Event_Id, JsonTupleMap(JSON_Series) as json:map[];
And I encounter this error:
ERROR org.apache.pig.tools.pigstats.PigStats - ERROR 0: java.io.IOException: Deserialization error: could not instantiate 'com.mozilla.pig.eval.json.JsonTupleMap' with arguments 'null'
Can someone help me in identifying the problem here.
It sounds like JSON_Series is null - have you tried outputting the data directly without trying to parse it as json (to see if the data is being loaded correctly)?
I have been trying to parse a complex json with com.mozilla.pig.eval.json.JsonTupleMap()
Json Field: {"Series":[{"DataType":"x","DataValue":"y"},{"DataType":"a","DataValue":"b"},{"DataType":"y","DataValue":"z"}]
Pig code: raw = LOAD '/user/nidhi/piped-data' USING PigStorage('|') AS (Device_Type:chararray, Event_Id:chararray, JSON_Series:chararray);
parsed = FOREACH raw GENERATE Device_Type, Event_Id, JsonTupleMap(JSON_Series) as json:map[];
And I encounter this error: ERROR org.apache.pig.tools.pigstats.PigStats - ERROR 0: java.io.IOException: Deserialization error: could not instantiate 'com.mozilla.pig.eval.json.JsonTupleMap' with arguments 'null'
Can someone help me in identifying the problem here.
Thanks, Nidhi