|
|
-
how to handle array field in JSON in PIGkeeyong han 2012-03-23, 23:03
A quick question on the JSON handling in PIG. I tried some JsonLoader called Elephant-Bird to load and handle JSON data like the followings:{ "SV":1, "AD":[ { "ID":"46931606", "C1":"46", "C2":"469", "ST":"46931", "PO":1 }, { "ID":"46721489", "C1":"46", "C2":"467", "ST":"46721", "PO":5 } ] } The loader works well for simple fields but it doesn't work well for any array field. I don't know how I can access elements in the array ("AD" field above) with this UDF or in any other way? Please advise. Thanks,-K |