Anyone know how to design the path of the time series and how to write this kind of query SQL in Apache IoTDB? I want to group the time
column according to specific time value ranges, and add some device filtering conditions, then sum the corresponding data value of specific fields. In my previous database (which is sql based), an example for this sql is select time,sum(power) as power from def.grid_h where project_id in (4, 7) and time >='2024-02-18 20:00:00' and time < '2024-02-18 20:10: 00' and time <= now() partition by time
. I want to know how can I achieve the same kind of query in IoTDB, since I know the grammar of IoTDB is not completely the same with sql.
Now the query language of Apache IoTDB is similar to SQL, but is not completely the same. Currently, the only way to achieve the query statement you want is to use select grid_4.*.power + grid_7.*.power from root.*.*.*.*
. In this way, the results are aligned by time, but if the time of the power
field is not aligned, the result will be null. If there is actually data for this time, you need to change it yourself. In the future, there are already plans to implement the table model based on standard SQL in IoTDB.