java之无法使用带有查询过滤器的数据存储输入来执行 app engine-mapreduce
当我尝试将数据存储查询与这样的过滤器一起使用时:
Query billQuery = new Query("Bill"); billQuery.<strong>setFilter(new Query.FilterPredicate("payedOn", Query.FilterOperator.GREATER_THAN, new Date()));</strong>
并尝试运行: new MapReduceSpecification.Builder, List>>>(<strong>new DatastoreInput(billQuery, mapShardCount)</strong>, new SimpleCounter("BillID"), new CountReducer(), new InMemoryOutput>()) .setKeyMarshaller(Marshallers.getStringMarshaller()) .setValueMarshaller(Marshallers.getLongMarshaller()) .setJobName("MapReduceTest count") .setNumReducers(reduceShardCount) .build();
我得到这个异常:
<strong>java.lang.IllegalArgumentException: payedOn: com.google.appengine.api.datastore.Entity is not a supported property type.</strong>
其中“paidOn”是数据存储实体中具有日期值的属性。
这个 ewxample 与 [example] 中的非常相似:
所以我想我做错了什么,但我不知道,这是一个标准的数据存储查询。 有什么建议么?
请您参考如下方法:
这是此行中的错误: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) 来自行修补它
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。



