AppEngine: number of returned result does not match downsample_to
when default limit is reached
#824
Labels
API
This issue or pull request is about API (e.g. unclear API, new API, API change, deprecation)
app:appengine_api
This issue or pull request is about astarte_appengine_api application
AppEngine API v2
This issue or pull request is about the new AppEngine API (v2)
user experience
This issue is about user experience
Milestone
If a device has sent more data than the default query limit (i.e. 10000), if the following query is performed:
The number of returned results is strictly lower than the
downsample_to
value. Also, the number of returned samples decreases as the total sample count increases.If the
limit
parameter is specified, the number of returned results does matchdownsample_to
, i.e. the following querycorrectly returns 100 samples. However, if
limit
> 10000, the incorrect behavior comes back.This could be due to the fact that two queries are performed: one for retrieving actual data, and one to count the number of returned samples. See
astarte/apps/astarte_appengine_api/lib/astarte_appengine_api/device/queries.ex
Lines 1278 to 1295 in d7997ac
There have been some issues in Cassandra regarding the behavior of the
LIMIT
param together withcount()
(see e.g. https://issues.apache.org/jira/browse/CASSANDRA-8216?focusedCommentId=15235570&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-15235570).When the actual issue is fixed, it would be great to thoroughly document the expected behaviour ( #629 👀).
The text was updated successfully, but these errors were encountered: