iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

fix aligned timeseries,downsampling query has many null results

Open dh-cloud opened this issue 3 years ago • 1 comments

Description

when use Aligned timeseries, we found the Downsampling Aggregate Query has many null results

in function calcFromBatch(),curReadCurArrayIndex use the max curReadCurArrayIndex or batchData.getReadCurArrayIndex(), but not considered the curReadCurListIndex, curReadCurArrayIndex may less than (batchData.getReadCurListIndex() * capacity + batchData.getReadCurArrayIndex()), still use curReadCurArrayIndex, cause null value.

IoTDB> select avg(longitude) from root.ln.wf0.1900 group by ([2022-03-24T16:08:00, 2022-03-24T16:30:00),1m); +-----------------------------+-------------------------------+ | Time|avg(root.ln.wf0.1900.longitude)| +-----------------------------+-------------------------------+ |2022-03-24T16:08:00.000+08:00| 36.76433287759623| |2022-03-24T16:09:00.000+08:00| 45.72716679175696| |2022-03-24T16:10:00.000+08:00| 50.42883342107137| |2022-03-24T16:11:00.000+08:00| 46.45799971620241| |2022-03-24T16:12:00.000+08:00| 42.55249982265135| |2022-03-24T16:13:00.000+08:00| 47.94933345317839| |2022-03-24T16:14:00.000+08:00| 40.68016653855641| |2022-03-24T16:15:00.000+08:00| 48.25216658314069| |2022-03-24T16:16:00.000+08:00| 43.38516653279465| |2022-03-24T16:17:00.000+08:00| 42.11850034693877| |2022-03-24T16:18:00.000+08:00| 44.323833274841306| |2022-03-24T16:19:00.000+08:00| 39.65049996773401| |2022-03-24T16:20:00.000+08:00| 43.65666652967533| |2022-03-24T16:21:00.000+08:00| 42.917000063260396| |2022-03-24T16:22:00.000+08:00| 47.75716644128163| |2022-03-24T16:23:00.000+08:00| 43.10416679382325| |2022-03-24T16:24:00.000+08:00| 44.4405001103878| |2022-03-24T16:25:00.000+08:00| 46.34416706164677| |2022-03-24T16:26:00.000+08:00| null| |2022-03-24T16:27:00.000+08:00| null| |2022-03-24T16:28:00.000+08:00| null| |2022-03-24T16:29:00.000+08:00| null| +-----------------------------+-------------------------------+


This PR has:

  • [x] been self-reviewed.
    • [ ] concurrent read
    • [ ] concurrent write
    • [ ] concurrent read and write
  • [ ] added documentation for new or modified features or behaviors.
  • [ ] added Javadocs for most classes and all non-trivial methods.
  • [ ] added or updated version, license, or notice information
  • [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage.
  • [ ] added integration tests.
  • [ ] been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

dh-cloud avatar Jul 11 '22 06:07 dh-cloud

This issue may be fixed in 0.13.1-SHAPSHOT by #5796. You can cherry-pick to master branch ~

liuminghui233 avatar Jul 11 '22 06:07 liuminghui233