使用 Java 客户端,我将插入这样的系列:
Serie serie1 =
new Serie.Builder(perfStat.pointCut).columns("time", "value").values(perfStat.start, perfStat.end - perfStat.start).build();
influxDB.write("pointcut_performance", TimeUnit.MICROSECONDS, serie1);
Grafana 尝试运行此查询,但失败了...它在 influxdb 管理工具中也失败了:
select mean(value) from "com.xxx.databunker.salesforce.processing.jms.SalesForceLeadMessageListener.onMessage(Message)" where time > now() - 6h group by time(1s) order asc
您收到此错误:错误:无法查找列
。如果去掉“where”子句,它将运行:
select value from "com.springventuregroup.databunker.salesforce.processing.jms.SalesForceLeadMessageListener.onMessage(Message)"
我在文档中找不到这个。非常感谢任何帮助!
编辑
问题是:数据库中显然存在可查询的数据,只要您的查询没有 where 接近。为什么我会收到该错误?
最佳答案
我遇到了完全相同的问题,经过几次测试后我发现问题在于我发送时间列的方式,
如果我有这些数据:
1326219450000 132850001 request http://yahoo.com 1
1326219449000 132840001 response http://tranco.com 1
然后,仅当我添加这部分“where time > now() - 1d”时,才会引发错误,我可以添加另一个 where 子句,但不能添加那个子句,除以 1000 后,我不再发送错误。
1412218778912 132830001 response http://google.com 1
1412218778720 132820001 request http://cranka.com 1
现在如果我保留两组:
1412133515000 132870001 request http://penca.com 1
1412133515000 132860001 request http://cranka.com 1
1326219450000 132850001 request http://yahoo.com 1
1326219449000 132840001 response http://tranco.com 1
我可以很好地执行查询,grafana 再次工作
select * from requests where time > now() - 1d
这里有一条关于流入时间以秒而不是毫秒为单位的评论,https://github.com/influxdb/influxdb/issues/572
关于java - InfluxDB "Couldn' t 查找列”当使用 WHERE 子句时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26130382/