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 2017-04-06 17:08:03

machete
Member
34 posts

machete said:

tWriteJSONField quotes numeric fields

Tags: [, bug]

Dear folks,

it seems the component tWriteJSONField doesn't respect the data types of incoming columns and just writes all values in Strings.
My expectation is, that numeric values are not enclosed in quotes in the output of the component.

This causes me big trouble in a use-case, where I have to transform an Excel file with several columns to a JSON String, since the numeric values are all quoted and thus the application parsing the file fails...

I'm working with TOS 6.2.1.20160704_1411.

Are there any known workarounds?

Example Job:
JSON_EXAMPLE.zip.zip

Screenshot:
mini_TalendJsonExample.png.png

Offline

#2 2017-04-06 18:34:57

cterenzi
Member
93 posts

cterenzi said:

Re: tWriteJSONField quotes numeric fields

According to the documentation: https://help.talend.com/display/TalendO … eJSONField
...the default type of all elements is String.  If you want an element to be numeric, you need to add an attribute named "type" and give it the static value of the type you want.

Offline

#3 2017-04-07 07:54:22

machete
Member
34 posts

machete said:

Re: tWriteJSONField quotes numeric fields

  cterenzi wrote:

According to the documentation: https://help.talend.com/display/TalendO … eJSONField
...the default type of all elements is String.  If you want an element to be numeric, you need to add an attribute named "type" and give it the static value of the type you want.

Hi cterenzi,

thanks for your reply, this actually works fine.

However, if you have > 200 columns where you have to define the type like this, this can be a tough job ^^ But I guess there is no other possibility right now *lookingforthetrainee*.

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy