我正在运行以下查询:
let data=datatable(timestamp: datetime, metric: real)
[
datetime(2020-01-01 00:00:00), 50.3,
datetime(2020-01-01 00:10:00), 50.4,
datetime(2020-01-01 00:20:00), 50.5,
datetime(2020-01-01 00:30:00), 50.6,
datetime(2020-01-01 00:40:00), 50.7,
datetime(2020-01-01 00:50:00), 50.8,
datetime(2020-01-01 01:00:00), 50.9,
datetime(2020-01-01 01:10:00), 50.01,
datetime(2020-01-01 01:20:00), 50.08,
datetime(2020-01-01 01:30:00), 50.13,
datetime(2020-01-01 01:40:00), 50.65,
datetime(2020-01-01 01:50:00), 50.99
];
data
| make-series avg(metric) on timestamp step 15m;
鉴于它metric
是 type real
,我期待一个只有实数的数组。但是,我得到以下结果:
"avg_metric": [
"50.349999999999994",
50.5,
"50.650000000000006",
50.8,
50.455,
50.08,
50.39,
50.99
]
可以看出,有些值是实数,但也有些值是字符串!当然,预期的行为是这个列表中只有实数。
为什么 Kusto/KQL 会以这种方式运行?