Victor Lyuboslavsky
03/25/2024, 4:11 PMSELECT ROUND(3.531, 2) as num;
returns "distributed_query_433":[{"num":"3.5299999999999998"}]
The correct result can be achieved by using a cast: SELECT CAST(ROUND(3.531, 2) as text) as num;
returns "distributed_query_435":[{"num":"3.53"}]
Should we document this in the Distributed queries section? Something like:
Query results are converted to text strings for transmission, which may result in a loss of precision for numeric values. Result values may be converted to text with SQLite cast,
which may be preferable for some queries. For example: SELECT CAST(ROUND(3.531, 2) as text) as num;
seph
osqueryi
than distributed? Because it looks correct in osqueryi…Victor Lyuboslavsky
03/25/2024, 11:22 PMVictor Lyuboslavsky
03/26/2024, 8:51 PM