Weird float number from sqlserver jdbc river in ElasticSearch -
i have sqlserver database , when import float type, it's import incorrect values:
db value: 9.0 es value: 90.0
db value: 16.00 es value: 16000000000000004
i have setup mapping value float type , set scale:2 parameter in river config without success.
my guess somewhere along line value parsed string , formatted in wrong culture. e.g. if decimal point comma, dot thousands separator (most of time) , ignored:
ps> get-culture lcid name displayname ---- ---- ----------- 1031 de-de german (germany) ps> [double]::parse('9.0') 90
and 16 doesn't seem exact 16 why you'll ridiculously large number.
the easiest fix change locale on server or machine. other option figure out whether that's bug in code or framework's. falls under common sense specify culture (e.g. invariant culture in .net or c locale in c) when formatting or parsing numbers intended machine consumption plenty of applications wrong too.
Comments
Post a Comment