Six Stars

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
11 REPLIES
Community Manager

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

Hi 
I tested your example file with studio 6.1.1,  and it works, i select 'xpath' model to read the file, see

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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
Community Manager

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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.
Six Stars

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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
One Star

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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).
One Star

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

I have downloaded the latest version TOS_BD-20160901_1543-V6.3.0M2, but still no luck?
Any update by when it would be fixed?
Thanks
Six Stars

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

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
One Star

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

Thanks Anselmo Smiley Happy

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

Hello guys,
I'm having the exact same issue with the tExtractJSONFields component, and followed these steps:

upgrading Talend to 6.3.0
updating 3 components (accessors-smart-1.1, asm-5.0.3 and json-smart-2.2.1)

But no luck so far.. I can not even use Xpath instead of JsonPath because it throws the "Cannot determine next state" error reported above.
Has any of you found a workaround until the 6.3.1 release is available ?
Thanks for your tips, 
Maxime.
One Star

Re: tFileInputJSON: no Getter for field scale in class BigDecimal

I solved it by having a tJavaRow and rounding the values.