tableau-log-viewer icon indicating copy to clipboard operation
tableau-log-viewer copied to clipboard

Large integers do not show correctly in TLV (double precision loss)

Open mringwald opened this issue 7 years ago • 2 comments

When the log contains large 64bit integers, they do not get correctly displayed. The last digits differ from the actual value.

Given the example log line: {"ts":"2018-11-28T17:33:01.230","pid":43075,"tid":"70000dbe3000","sev":"info","req":"-","sess":"10483","k":"large-integer","v":{"some-id":9223372036855065056}} TLV will show "some-id: 9223372036855064576"

This is probably due to parsing the number as a double first and loosing precision on the way. I am not sure if the underlying JSON parser supports the whole range of int64 and this is a TLV issue or if this is a limitation of the JSON parser itself.

mringwald avatar Dec 03 '18 10:12 mringwald

Hi, I think this is a limitation of the JSON parser and how Javascript does numbers (if I remember correctly, every number is a double precision float). There might be ways to improve this in TLV; right now we are getting the default behavior of the Qt JSON parser.

Do you know if Tableau or Hyper is already logging 64-bit integers in real world scenarios?

luiseeo avatar Dec 03 '18 18:12 luiseeo

From a quick search, it looks like the JSON standard leaves it up to the implementation how to handle int64s.

Yes, Hyper does log some 64-bit integers. There are some cases where information is encoded in the most significant bit, resulting in very large integers when logged.

mringwald avatar Dec 04 '18 15:12 mringwald