Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
YK3
Contributor II
Contributor II

How can I get Extract Json Field and Other field from txt/DB

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

0695b00000RiDamAAF.png

The Expected Output from job is

0695b00000RiDaTAAV.png

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.

Labels (3)
4 Replies
Anonymous
Not applicable

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

YK3
Contributor II
Contributor II
Author

Hi @Shicong Hong​ .Thanks for Reply.

I have tried to design the job.

0695b00000RiKBKAA3.pngTo make it simple I have taken only 1 field SRC_CLUSTER in my DB input query.So The output of tDBinput component is 0695b00000RiKCXAA3.pngThen I tried to configure first  tExtractJsonFields components like below

0695b00000RiKDQAA3.pngThen I configure second tExtractJsonFields components like this

0695b00000RiKDaAAN.pngwhen I tried to run the job .i am getting below error message

0695b00000RiKE2AAN.pngCould you please help

Anonymous
Not applicable

It is a code compilation error, it seems you are using a unsupported Java, which's version of studio are you using? Java version?

 

YK3
Contributor II
Contributor II
Author

Hi @Shicong Hong​ 

Talend studio version is 7.1.1

and Java Version is 8