Geomesa 特征计数总是返回零

Geomesa Feature Count always returning zero

我正在开发 geomesa 客户端来执行基本的读写和删除操作。我还创建了一个函数,它将 return 匹配指定查询的特征计数,但是它总是 return 为零,我还尝试了 DataStore stats 来获取匹配的特征计数,它给出了正确的结果但是操作很慢。以下是我的客户代码:

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;
  }

任何人都可以帮助我找出为什么它 returning 0 尽管特征集合中存在特征。或者是否存在其他首选技术来获取匹配的特征数?欢迎任何建议或澄清。

基于您发送至 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 的电子邮件中有关该问题的附加信息。它应该在下一个版本(1.3.2)中修复,或者您可以在本地构建分支。 与此同时,'exact' 计数应该仍然有效,尽管它们会更慢。启用精确计数的说明是 here and here.