Search code examples
databaseinsertsql-insertapache-iotdb

How do I calculate the mean value of time series data for two measuring points in Apache IoTDB Version 0.12?


I currently use Apache IoTDB Version 0.12 and I have a question that needs advice. How to find the mean data value of two measuring points according to certain time series? I checked the official user guide of V0.12 and did not find any related statement.

Should the mean value only be calculated before inserted into storage? Or is there any other ways?


Solution

  • It can be solved with the following statement, but you need to upgrade Apache IoTDB to Version 0.13.4 or Version 1.0.0:

    select (WROT HubTmp+WROT RotPos)/2 from root.BHSFC.Q1.W002
    

    Your current version, Version 0.12.0, can not execute binary operators. If you do not upgrade IoTDB, you can only calculate the average value by querying the two parameters separately and traversing then.