mozilla-metrics / akela

A bunch of utility classes for Java, Hadoop, HBase, Pig, etc.
Apache License 2.0
76 stars 31 forks source link

Deserialization error: could not instantiate 'com.mozilla.pig.eval.json.JsonTupleMap' with arguments 'null' #10

Open irnidhi opened 9 years ago

irnidhi commented 9 years ago

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

mreid-moz commented 9 years ago

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)?