You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2014-04-09 06:54:22

sanvaibhav
Member
1719 posts

sanvaibhav said:

[resolved] unexpected format in tFileOutputJson output

Hi,

I am getting invalid format in tFileOutputJson as below
{"data":[{"output":"{\"employee\":{\"id\":\"1\",\"name\":\"Simon\",\"lastname\":\"Tod\",\"training\":{\"trainingCode\":\"AX2\",\"trainingCost\":\"2345\"}}}"}]}

Please refer to http://www.talendforge.org/forum/viewto … 11#p132011 about input data and design.

Output on the console is correct output for the same job.

[Thread-1       ] XMLSerializer                  INFO  Using default type string
{"employee":{"id":"1","name":"Simon","lastname":"Tod","training":{"trainingCode":"AX2","trainingCost":"2345"}}}

How to correct output json file? I am using TOS5.3.

Thanks
Vaibhav

Last edited by sanvaibhav (2014-04-09 06:57:37)


Talend Certified Consultant

Offline

#2 2014-04-14 08:58:41

shong
Talend Team


shong said:

Re: [resolved] unexpected format in tFileOutputJson output

Hi Vaibhav

tFileOutputJson don't provide a GUI for configuring Json tree, this component is just designed to outputs a simple json file with only one data block, if you want to output a complex Json file, you need to use tWriteJsonField which provides a GUI for configuring complex Json tree, and link tWriteJsonField to a tFileOutputDelimited to output the result as a json file. For example:
tFixedFlowInput--main--tWriteJsonField--main-->tFileOutputDelimited

Shong


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the global leader of open source data management and application integration solutions!

Offline

#3 2014-04-14 11:19:48

sanvaibhav
Member
1719 posts

sanvaibhav said:

Re: [resolved] unexpected format in tFileOutputJson output

Hi,

Following were small changes which needs to consider for getting correct json file.

1) Select the output column as training in tWriteJsonField which was the loop element in Json tree
2) Remove delimiter in tFileOutputDelimited use only "", else the file is pre or post fixed by delimiter for those many number of columns

Thanks
Vaibhav

Last edited by sanvaibhav (2014-04-14 11:20:34)


Talend Certified Consultant

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy