Can't execute appengine-mapreduce using DatastoreInput with request filters

when i try to use datastore Query with filter like this:

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

and tries 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 am getting this exception:

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

where 'paidOn' is a property with a Date value in the datastore object.

This ewxample is very similar to the one in [example]:

so I think I am doing something wrong, but I have no idea that this is a standard datastore query. Any suggestions?

+3


source to share


1 answer


It's a bug on this line: https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/master/java/src/main/java/com/google/appengine/tools/mapreduce/inputs/DatastoreShardStrategy.java#L386 Before fixed you could avoid the problem by putting both bounds (top and bottom) or fix it yourself by replacing item.get (0) with item.get (0) .getProperty (propertyName)



+2


source







All Articles