influxdb查询报错:*query.stringInterruptIterator
转载请注明出处:
influxdb 查询时报错:unsupported mean iterator type: *query.stringInterruptIterator
> SELECT mean("used") FROM "telemetry_dev_mem_monitor" WHERE ("host" =~ /^Ruijie_1$/) AND time >= now() - 5m GROUP BY time(2m), "host", "name" fi
ERR: unsupported mean iterator type: *query.stringInterruptIterator
错误原因:
influxdb在执行mean函数的字段used 属性值存在非数值类型(如整数或浮点数);通过检查代码发现,used属性值在插入数据库时,用的是string类型;
解决方法:
将string类型转为数值类型,便可正常查询和计算