mohan-nishit / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

BigDecimal not a supported type for AppEngine Datastore #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you attempt to pass back in a value generated from the persistence layer to 
query (ie a decimal type) you will get the following error. We probably need to 
do a conversion in the lower layer.

Caused by: java.lang.IllegalArgumentException: LOCATION_GEOPOINT_LAT: 
java.math.BigDecimal is not a supported property type.
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:157)
    at com.google.appengine.api.datastore.Query$FilterPredicate.<init>(Query.java:574)
    at com.google.appengine.api.datastore.Query.addFilter(Query.java:260)
    at org.opendatakit.common.persistence.engine.gae.QueryImpl.addFilter(QueryImpl.java:259)
    at org.opendatakit.aggregate.query.submission.QueryBase.addFilterGeoPoint(QueryBase.java:73)
    at org.opendatakit.aggregate.query.submission.QueryByUIFilterGroup.<init>(QueryByUIFilterGroup.java:66)
    at org.opendatakit.aggregate.server.SubmissionServiceImpl.getSubmissions(SubmissionServiceImpl.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
    ... 58 more

Original issue reported on code.google.com by wbrune...@gmail.com on 30 Apr 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Fixed in uiexperiment with the merge of May 5th.

Original comment by mitchellsundt@gmail.com on 20 Jun 2011 at 6:31

GoogleCodeExporter commented 9 years ago
I just tried to create a filter in the UI, which in turn creates the a query 
and I got the following error again.
Caused by: java.lang.IllegalArgumentException: LOCATION_GEOPOINT_LAT: 
java.math.BigDecimal is not a supported property type.
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184)
    at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:157)
    at com.google.appengine.api.datastore.Query$FilterPredicate.<init>(Query.java:575)
    at com.google.appengine.api.datastore.Query.addFilter(Query.java:260)
    at org.opendatakit.common.persistence.engine.gae.QueryImpl.addFilter(QueryImpl.java:273)
    at org.opendatakit.aggregate.query.submission.QueryBase.addFilterGeoPoint(QueryBase.java:73)
    at org.opendatakit.aggregate.query.submission.QueryByUIFilterGroup.<init>(QueryByUIFilterGroup.java:70)
    at org.opendatakit.aggregate.server.SubmissionServiceImpl.getSubmissions(SubmissionServiceImpl.java:70)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
    ... 62 more

Original comment by wbrune...@gmail.com on 20 Jun 2011 at 7:41

GoogleCodeExporter commented 9 years ago
To be clear. I am filtering on a greater than or less than with a value on a 
geopoint.

Original comment by wbrune...@gmail.com on 20 Jun 2011 at 7:54

GoogleCodeExporter commented 9 years ago
Checked in fix -- 
http://code.google.com/p/opendatakit/source/detail?r=b9206b43d6eb3e353fa23630169
d301b7425747f&name=uiexperiment&repo=aggregate

With 1.5.0.1, type-checking has been moved earlier in the process.
Also, changed to pass Double values into BigTable, rather than strings.

Original comment by mitchellsundt@gmail.com on 20 Jun 2011 at 8:59

GoogleCodeExporter commented 9 years ago
You will need to delete your local db so that the datastore type is updated to 
Double.

Original comment by mitchellsundt@gmail.com on 20 Jun 2011 at 9:02