QueryPropertyHistory returns partially empty rows
Hi,
I just experienced a problem with QueryPropertyHistory when querying data from a thing (logged with a Value Stream). When I select a time interval I'm interested in the result might have rows where some values are empty (undefined). However, if I expand the time frame (set an earlier startTime) the rows that were partially empty are usually filled in and there are new rows with some empty values.
I have understood that writing data to streams is asynchronous but I'd expect that the writing should be done one event (row) at a time. This can happen even if there are minutes between the query start time and the actual first "row" time.
Example (start date X, end date Y):
| value1 | value2 | timestamp |
|---|---|---|
| 1 | 9 | just-example-dont-care |
| 2 | 8 | just-example-dont-care |
| 3 | 7 | just-example-dont-care |
| 4 | just-example-dont-care |
Example (start date X - Z, end date Y):
| value1 | value2 | timestamp |
|---|---|---|
| 1 | 9 | just-example-dont-care |
| 2 | 8 | just-example-dont-care |
| 3 | 7 | just-example-dont-care |
| 4 | 6 | just-example-dont-care |
| 5 | just-example-dont-care |
Any ideas? This really messes up my system.
<EDIT>
The same happens if I call the QueryPropertyHistory from a service I created or "manually" from the Thing -> Services -> Generic Services -> QueryPropertyHistory. I've changed only the endDate & startDate (query is empty and maxItems is 500).
Could this be related?
</EDIT>
BR,
Risto

