tFileInputJSON: no Getter for field scale in class BigDecimal
Hello,
I'm reading some JSON files using tFileInputJSON component configured as the attached screenshot.
The problem is: whenever a file has numeric values with large decimal scale like 0.39268000000000003 and not enclosed by double quotes, I get the following exception:
java.lang.RuntimeException: no Getter for field scale in class java.math.BigDecimal
This happens no matter the data type configured in the component schema, even if everything is configured as String data type.
Here is a sample of the file:
{
"cemaden":
}
The cause of this exception is highlighted in bold. If this field is enclosed by double quotes, the file is read without errors.
Is there a way to overwhelm this exception without editing the file?
Thanks in advance.
Anselmo
Hi shong, thank you. I'll try as you suggested.
Did it also succeeded in your environment using JsonPath in the Read by field?
According to the manual, "is recommended to read the data by JSONPath in order to gain better performance"
https://help.talend.com/search/all?query=tFileInputJSON&content-lang=en Regards,
Anselmo
Hi
The JSONPath model does not work, it say that no data is read from this file. If the file is not very big, there is no obvious performance difference.
Regards
Shong
Hello,
I'm facing the same issue, both with tFileInputJson and tExtractJsonFields. Also, if I try to use the xpath model I get "Cannot determine next state" error. So I'm stuck here... is there any way of solving any of those errors?
Thanks.
Hi,
Regarding JSONPath, I reported a bug here:
https://jira.talendforge.org/browse/TDI-35990 And about "Cannot determine next state" error with xpath I don't know what could cause this, maybe you could provide more details of your component's configuration.
Regards,
Anselmo
Hi,
I am glad to see you guys working on this, since it is a big sticking point for my team whether to move ahead with Talend's Data Integration product.
Can the dev team also include a fix to the ticket for the tExtractJSONFields component as well? It has the same issue with big decimals, and is the main problem I am having right now with the software.
In addition, when the fix is implemented, would it be possible to have the software handle decimal numbers that are too large for the BigDecimal datatype? Having an option for the user to truncate or round just before the parse is done would be ideal, because it is very possible a JSON document could have these large problematic numbers, due to the way JavaScript handles numbers internally (i.e., a number is a number).
Hello Ahmed, please follow jira ticket
https://jira.talendforge.org/browse/TDI-35990 It seems that this bug is going to be resolved in the next release, 6.3.1.
Best regards,
Anselmo