kevinweil/elephant-bird — pull request #378 by gurmeetsaran (2014-03-14 06:01:32+00:00)
Title: Added Support for Handling Invalid JSON Records

Hi Kevin,

I have added support for handling Invalid JSON Records. Currently It just filters out invalid JSON Records. I have added support to return invalid records which can be segregated into good and bad records. This can help if we want to report invalid records to the upstream user who is generating the records.

This can be changed by setting the -invalidRecord option in the JsonLoader constructor
Example:
source_data = LOAD '$input' USING com.intuit.iac.pig.udf.JsonLoader('-nestedLoad -invalidRecord') as (json:map[]);
SPLIT source_data INTO source_data_good_record IF json#'error_string' is null,source_data_bad_record IF json#'error_string' !='';