'wrong result when applying aggregation function on series with * and where clause

There is an error with the result of aggregation on series with * and where clause.The value of count(root.ln.wf02.wt02.temperature) should be 21 but it turned out to be 5 according to result of the select count(temperature) from root.ln.. where temperature > 50.0. The error also happened with regard to the avg function. enter image description here

enter image description here



Solution 1:[1]

select temperature from root.ln.*.* where temperature > 50 means select root.ln.*.*.temperature ... where root.ln.*.*.temperature > 50.

Therefore

  • root.ln.wf01.wt01.temperature,
  • root.ln.wf01.wt02.temperature
  • root.ln.wf02.wt01.temperature
  • root.ln.wf02.wt02.temperature

will be considered at the same time.

If you want to take just root.ln.wf02.wt02 as filter, write sql like this: select temperature from root.ln.*.* where root.ln.wf02.wt02.temperature > 50

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1