MongoInput (Json) to Hive (text) using tExtractJSON giving an error.

Four Stars

MongoInput (Json) to Hive (text) using tExtractJSON giving an error.

Hi Experts,
I'm trying to load HIVE tables (text - Flat) format from MongoDB (JSON format). I have used tExtractJSONFields component, but getting an error "Error on line 1 of document  : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.". Searched talendforge forum for help, but didn't help much. 
Here is my mapping
tMongoInput --> tExtractJsonField ---> tlogRow --->tHDFSOutput ---> tHIVECreateTable ---> tHIVELoad
Any help is much appreciated.
Regards
cmadaka
Moderator

Re: MongoInput (Json) to Hive (text) using tExtractJSON giving an error.

Hi,
Did you check your json source file to see if it is well-formed (Json Validator JSONLint)?
How did you set your tExtractJsonField  component? Could you please also paste your json source file here(a sample content is OK)?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: MongoInput (Json) to Hive (text) using tExtractJSON giving an error.

Thanks Sabrina. tExtractJsonField was set-up using 
Read by : XPath and 
JSON Field : triggerFired, 
Loop XPath Query : ""
Here is the sample JSON record. If i remove the FiringDate field in the subdocument, job seems to run fine. other wise i get an error. Don't have any issue with insertDate and createtimestamp date field.
{
    "_id" : ObjectId("22349j3242394-234"),
    "insertDate" : ISODate("2014-06-30T04:00:00.000Z"),
    "Identifier" : "Raw Data",
    "status" : "Accepted",
    "userId" : "93837574849",
    "createdTimestamp" : ISODate("2015-07-10T22:01:44.000Z"),
    "triggerFired" :
}

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now