无法使用带有查询筛选器的数据存储输入执行 appengine-mapreduce



当我尝试将数据存储查询与这样的过滤器一起使用时:

Query billQuery = new Query("Bill"); billQuery.setFilter(new Query.FilterPredicate("payedOn", Query.FilterOperator.GREATER_THAN, new Date()));

并尝试运行: new MapReduceSpecification.Builder, List>>>(new DatastoreInput(billQuery, mapShardCount), new SimpleCounter("BillID"), new CountReducer(), new InMemoryOutput>()) .setKeyMarshaller(Marshallers.getStringMarshaller()) .setValueMarshaller(Marshallers.getLongMarshaller()) .setJobName("MapReduceTest count") .setNumReducers(reduceShardCount) .build();

我得到这个例外:

java.lang.IllegalArgumentException: payedOn: com.google.appengine.api.datastore.Entity is not a supported property type.

其中"paidOn"是数据存储实体中具有日期值的属性。

这个 ewxample 与 [示例] 中的 ewxample 非常相似:

所以我想我做错了什么,但我不知道,这是一个标准的数据存储查询。有什么建议吗?

这是

这一行中的一个错误:https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/master/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L386在修复之前,您可以通过提供两个边界(上限和下限)来避免此问题,或者通过将item.get(0)替换为item.get(0).getProperty(propertyName)来自己修补它

最新更新