2014-12-09 58 views
3

,當我嘗試使用數據存儲查詢,像這樣的過濾器:無法執行的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' 爲pr數據存儲實體中帶有Date值的operty。

這ewxample是非常相似的,在【示例】:

,所以我想我做錯了什麼,但我不知道,這是一個標準的數據存儲區查詢。 有什麼建議嗎?

回答

2

這是此行的一個錯誤:https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/master/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L386 直到固定的,你可以通過提供兩個邊界(上,下),避免問題或item.get與item.get(0)代替自己修補它(0) .getProperty(propertyName)

+0

感謝您的回覆,我會嘗試 – mlesikov 2015-01-16 13:06:51

+0

修復它已提交給gitHub(但尚未推送給maven)。 – ozarov 2015-01-17 01:03:08

+0

是的,它現在正在工作!謝謝。 – mlesikov 2015-01-28 16:08:57