Closed SudhakarSA closed 5 years ago
Can you please provide more detailed example with code-snippet of your ch.query()
calls?
I found the root cause. It seems that type UInt64
only has this issue(return string value instead of number). Query and Result as follows
Query:
SELECT anyLast(uptime) AS "uptime", anyLast(loadAvgFifteenMinute) AS "loadAvgFifteenMinute",
anyLast(cpuUserPercentage) AS "cpuUserPercentage", anyLast(cpuCores) AS "cpuCores",
anyLast(memoryUsedBytes) AS "memoryUsedBytes", anyLast(memoryFreeBytes) AS "memoryFreeBytes",
hostname FROM system
Result:
{ rows:
[ {
uptime: '4740000',
loadAvgFifteenMinute: 0.17,
cpuUserPercentage: 6.03,
cpuCores: 1,
memoryUsedBytes: '984068096',
memoryFreeBytes: '1106239488',
hostname: 'ubuntu'
} ],
columns:
[ { name: 'uptime', type: 'UInt64' },
{ name: 'loadAvgFifteenMinute', type: 'Float32' },
{ name: 'cpuUserPercentage', type: 'Float32' },
{ name: 'cpuCores', type: 'UInt8' },
{ name: 'memoryUsedBytes', type: 'UInt64' },
{ name: 'memoryFreeBytes', type: 'UInt64' },
{ name: 'hostname', type: 'String' } ] }
Look at uptime
, memoryUsedBytes
and memoryFreeBytes
values. They are coming as string.
@nezed how to resolve this issue?
You cannot use 64bit integers in Javascript directly. Only 52bits
I have a field called
duration
whichUInt64
. If I pass select query withduration:anyLast
, it returns string. Here I expect number instead of string. why does it happen?