Function: Cumulative sum computes the running total of one time series. It occurs in select clause of SQL statement.
Input: Input column data type should be a numeric type.
Output: If the input data type is unsigned int type, the result data type is uint64_t. If the input data type is signed int type, the result data type is int64_t. If the input data type is float or double, the result data type is double. The function also outputs the timestamp of the current row.
Table: The csum function only applies to the normal table, child table, and super table with group by tbname.
Nested Query: The csum function applies to both outer query and nested query.
Note: Can't be used with +-*/ arithmatic operations,like csum(col1) + csum(col2), can only be used with aggragation functions.
Function: Moving Average Function Computes the rolling simple average over k values of one time series. It occurs in select clause of SQL statement. If the input time series has less than k values, no result is calculated.
Input: Input column data should be a numeric type.
Output: The Result data type is double. The function also outputs the timestamp of the current row.
Parameter: K is an integer between 1 and 1000.
Table: The mavg function only applies to the normal table, child table, and super table with group by tbname.
Nested Query: The mavg function applies to both outer query and nested query.
Note: Can't be used with +-*/ arithmatic operations, like mavg(col1, k1) + mavg(col2, k1); can only be used with normal columns, selection and projection functions,can't be used with aggragation functions.