我正在开发geomesa客户端来执行基本的读写和删除操作。 我还创建了一个函数,它将返回指定查询的匹配功能计数,但它总是返回零,我也尝试使用DataStore统计信息来获取匹配的功能计数,它给出了正确的结果但操作非常慢。 以下是我的客户代码:
public int getRideCount(Long rideId) throws Exception { int count = 0; if(rideId != null){ count = fs.getCount(new Query(tableName, CQL.toFilter("r="+rideId))); //count = ((Long) (ds.stats().getCount(sft, CQL.toFilter("r=" + rideId), true).get())).intValue(); } return count; }任何人都可以帮助我找到为什么它返回0虽然功能集合中存在功能。 或者存在其他优选技术来获取匹配特征计数? 欢迎提出任何建议或澄清。
I am developing geomesa client to perform basic read write and delete operations. I have also created a function which will return matching feature count for specified query, however it always returns zero, i also tried DataStore stats for fetching the matching feature count, it gives the correct result but operation is very slow. Below is my client code:
public int getRideCount(Long rideId) throws Exception { int count = 0; if(rideId != null){ count = fs.getCount(new Query(tableName, CQL.toFilter("r="+rideId))); //count = ((Long) (ds.stats().getCount(sft, CQL.toFilter("r=" + rideId), true).get())).intValue(); } return count; }Can anyone help me in finding why it returning 0 though features exists in feature collections. or there exists other preferred techniques to fetch the matching feature count?. Any suggestion or clarifications are welcomed.
最满意答案
根据您的电子邮件到几何开发列表中的其他信息,我认为这是由于没有日期属性的简单要素类型中的错误引起的。 我已经在这里开了一张票, 这里有一个PR 来解决这个问题。 它应该在下一个版本(1.3.2)中修复,或者您可以在本地构建分支。 与此同时,'确切'计数应该仍然有效,尽管它们会更慢。 启用精确计数的说明在这里和这里 。
Based on the additional info from your email to the geomesa dev list, I believe this is caused by a bug in simple feature types that don't have a date attribute. I've opened a ticket here and a PR here for the issue. It should be fixed in the next release (1.3.2), or you can build the branch locally. In the meantime, the 'exact' counts should still work, although they will be slower. Instructions for enabling exact counts are here and here.
更多推荐
发布评论