tianyi zhang
tianyi zhang

Reputation: 129

When using `max_value` in Apache IoTDB, why did the result returned `NaN` instead of the only data value included?

I would like to ask about a schenario that I query data by month in Apache IoTDB. I use the max_value() method to query the maximum value, and the result of the query after grouping is not the maximum value, but NaN. The last value of our data has data value in it, and the other values are marked as NaN. These NaN values are inserted manually. I want to know why the maximum value did not returned to be the last data value in the time series?

Upvotes: 0

Views: 22

Answers (1)

Marcos_Zyk
Marcos_Zyk

Reputation: 354

Any value compared with NaN will return false result in Apache IoTDB. This means that when initializing the MAX_VALUE aggregation, if the first value encountered is NaN, then when making > judgments, it will always return false, so the aggregation result will be NaN. If the first non-null value encountered is not NaN, the aggregation result will be obtained normally. Therefore, if your first value has no value, you can express it as a NULL value instead of NaN value to avoid your error.

Upvotes: 0

Related Questions