Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III

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.
Labels (3)
5 Replies
Anonymous
Not applicable

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

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

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?
Anonymous
Not applicable

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:
https://community.talend.com/t5/Design-and-Development/Image-from-MySQL-to-diretory/td-p/109198
Shong
_AnonymousUser
Specialist III
Author

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?