Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm working on job talend who consists to Export DB to Csv.
The table contains some normal fields and some Json String fields.Like below
The Expected Output from job is
I am trying to this by using component TExtractJsonFields.But I am not sure how to configure this component
I have attached required data in txt file if you want to try it.
Thanks very much for your Help.
Hi
One tExtractJsonFields can only extract data from one field, you need to use two tExtractJsonFields components to extract data from each field, merge all the fields and write them to file. eg:
tDBInput--row1--tReplicate--row2--tExtractJsonFields--tHashOutput1
--row3--tExtractJsonFields--tHashOutput2
|onsubjobok
tHashInput1--main--tMap1----out1---tFIleOutputDelimited1
|lookup
tHashInput2
tHashOutput1,tHashOutput2: store the output into memory for used later.
tHashInput1: read data from tHashOutput1
tHashInput2: read data from tHashOutput2
tMap1: do an inner job based on LKUP_TL_ID (assuming this field is the primary key in DB) to merge all fields together.
Please try and let me know if you have any questions.
Regards
Shong
Hi @Shicong Hong .Thanks for Reply.
I have tried to design the job.
To make it simple I have taken only 1 field SRC_CLUSTER in my DB input query.So The output of tDBinput component is
Then I tried to configure first tExtractJsonFields components like below
Then I configure second tExtractJsonFields components like this
when I tried to run the job .i am getting below error message
Could you please help
It is a code compilation error, it seems you are using a unsupported Java, which's version of studio are you using? Java version?
Hi @Shicong Hong
Talend studio version is 7.1.1
and Java Version is 8