One Star

Extract JSON from MySQL blob field

Hello,
I'm trying to create a job that will extract JSON from a blob field in MySQL, then create columns in another database from the JSON data. I cant figure out how to get the JSON out of the object that is returned from the database. Is there a component I can use to parse the JSON out of the row returned from the DB?
Thanks.
5 REPLIES
Seventeen Stars

Re: Extract JSON from MySQL blob field

I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
One Star

Re: Extract JSON from MySQL blob field

I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.
One Star

Re: Extract JSON from MySQL blob field

I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.

Oops..
Assuming I don't have a choice, what can I do to extract the JSON?
Community Manager

Re: Extract JSON from MySQL blob field

I would not use a BLOB field, better using a CLOB field. CLOBs can be retrieved as normal varchar fields.

Oops..
Assuming I don't have a choice, what can I do to extract the JSON?
Read the Blob data from Mysql to a json file first, and then use a tFileInputJson to read the json file, refer to this topic:
http://www.talendforge.org/forum/viewtopic.php?id=8633
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Extract JSON from MySQL blob field

Thanks, Shong.
We were able to get it into a file by simply connecting it to a tfileoutputdelimited component. Each json object is on a new line. When we try to process this it tries to read the entire file instead of each line. Is this not the right way to do it? Would your previous suggestion be a better approach?