when I try to use datastore Query with a filter like this :
Query billQuery = new Query("Bill");
billQuery.setFilter(new Query.FilterPredicate("payedOn", Query.FilterOperator.GREATER_THAN, new Date()));
and trying to run :
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();
I get this exception :
java.lang.IllegalArgumentException: payedOn: com.google.appengine.api.datastore.Entity is not a supported property type.
where 'paidOn' is property with Date value in a datastore entity.
This ewxample is very similar to that in the [example] :
so I guess I'm doing something wrong, but I have no idea, it is a standard datastore query. Any suggestions?
This is a bug in this line: https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/master/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L386 Until fixed, you could avoid the issue by supplying both bounds (upper and lower) or patch it yourself by replacing item.get(0) with item.get(0).getProperty(propertyName)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With