Why does a WHERE predicate on one path filter an aggregate on another path in Apache IoTDB tree model?
21:49 29 Jun 2026

In Apache IoTDB 2.0.8, under root.sg1.cross_filter I have two different paths: line7.run_state and line8.temperature. When I aggregate line8 temperature with a predicate on line7 state, the average only uses timestamps where line7 is OK, not all temperature points from line8.

Timeseries definitions and sample rows:

CREATE TIMESERIES root.sg1.cross_filter.line7.run_state WITH DATATYPE=TEXT, ENCODING=PLAIN;
CREATE TIMESERIES root.sg1.cross_filter.line8.temperature WITH DATATYPE=DOUBLE, ENCODING=PLAIN;
INSERT INTO root.sg1.cross_filter.line7(timestamp, run_state) VALUES (1000, 'OK');
INSERT INTO root.sg1.cross_filter.line7(timestamp, run_state) VALUES (2000, 'DOWN');
INSERT INTO root.sg1.cross_filter.line7(timestamp, run_state) VALUES (3000, 'OK');
INSERT INTO root.sg1.cross_filter.line8(timestamp, temperature) VALUES (1000, 10.0);
INSERT INTO root.sg1.cross_filter.line8(timestamp, temperature) VALUES (2000, 100.0);
INSERT INTO root.sg1.cross_filter.line8(timestamp, temperature) VALUES (3000, 30.0);
INSERT INTO root.sg1.cross_filter.line8(timestamp, temperature) VALUES (4000, 40.0);

Filter the line8 temperature aggregate by line7 state:

SELECT avg(line8.temperature) FROM root.sg1.cross_filter WHERE line7.run_state = 'OK';

Actual result:

+--------------------------------------------+
|avg(root.sg1.cross_filter.line8.temperature)|
+--------------------------------------------+
| 20.0|
+--------------------------------------------+

Control query: aggregate without the cross-path status filter:

SELECT avg(line8.temperature) FROM root.sg1.cross_filter;

Comparison result:

+--------------------------------------------+
|avg(root.sg1.cross_filter.line8.temperature)|
+--------------------------------------------+
| 45.0|
+--------------------------------------------+

My question:

In tree model, does the WHERE predicate first select timestamps where line7.run_state = 'OK' on the shared time axis, and then let avg(line8.temperature) aggregate only line8 values at those timestamps? If line8 has a value at 4000 ms but line7 has no state there, is that point excluded by this cross-path WHERE?

time-series apache-iotdb