Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am reading XML data and using the component tExtractJSON as below, one of the fields has data with float values
{"ID":1,"Rate":0.01,"Generated":true}
The job fails with below error
java.lang.RuntimeException: no Getter for field scale in class java.math.BigDecimal
Hi @Karuetl ,
There are many records in your json have a large bigdecimal value and below are those records from your input file.
"Rate":0.0031399999279528856 "Rate":0.004999999888241291 "Rate":0.0070000002160668373 "Rate":0.0074999998323619366 "Rate":0.010999999940395355 "Rate":0.012500000186264515 "Rate":0.014999999664723873 "Rate":0.017999999225139618 "Rate":0.0215000007301569 "Rate":0.02370000071823597 "Rate":0.02500000037252903 "Rate":0.046999998390674591 "Rate":0.05000000074505806 "Rate":0.052200000733137131 "Rate":0.0560000017285347 "Rate":0.057199999690055847 "Rate":0.059999998658895493 "Rate":0.064999997615814209 "Rate":0.068000003695487976 "Rate":0.070000000298023224 "Rate":0.079999998211860657 "Rate":0.0949999988079071 "Rate":0.11299999803304672
The solution to your issue is, you need to keep the value of the Rate key value in double quotes in all objects of your json. I can extract 25957 records from the given input sample file.
--
Please give Kudos and mark topics as solved where appropriate.
Please show the details of your tExtractJSONFields component as well as the schema.
I tried both string and float and bigdecimal for rate column
You could try quoting the values in your JSON, that would certainly work.
Can you put a tLogRow right before your tExtractJSONFields to see exactly what the data looks like?
hi
Here my doubt is if your reading xml data why to to textractjson fields,as per my knowledge you should use tExtractXMLField.
Regards
rekha
The data in the XML file are in key value format
Do you mean value in the enclosed with double quotes ? if that's the case I dont guess we can as we get xml file from API
I can able to extract the columns even it is a bigdecimal. For example i took sample data with fixedflow and passed it through extractjson. I am getting output with bigdecimal/string as its datatype.
i tried its not working for me
Hi @Karuetl,
The error you are getting is known issue and you can find in many tickets and the main ticket is here https://jira.talendforge.org/browse/TDI-35990?_ga=2.26270973.1977352456.1558436214-260665681.1558065...
There are many records in your json have a large bigdecimal value and below are those records from your input file.
"Rate":0.0031399999279528856 "Rate":0.004999999888241291 "Rate":0.0070000002160668373 "Rate":0.0074999998323619366 "Rate":0.010999999940395355 "Rate":0.012500000186264515 "Rate":0.014999999664723873 "Rate":0.017999999225139618 "Rate":0.0215000007301569 "Rate":0.02370000071823597 "Rate":0.02500000037252903 "Rate":0.046999998390674591 "Rate":0.05000000074505806 "Rate":0.052200000733137131 "Rate":0.0560000017285347 "Rate":0.057199999690055847 "Rate":0.059999998658895493 "Rate":0.064999997615814209 "Rate":0.068000003695487976 "Rate":0.070000000298023224 "Rate":0.079999998211860657 "Rate":0.0949999988079071 "Rate":0.11299999803304672
The solution to your issue is, you need to keep the value of the Rate key value in double quotes in all objects of your json.
--
Please give Kudos and mark topics as solved where appropriate.