The multi-period estimation function can estimate time series in different time periods and perform a series of operations, such as Fourier transform, to extract period data.
The function estimates time series data on a period basis.
select ts_period_detect(x, y,minPeriod,maxPeriod,samplePeriod,sampleMethod)
|x||Time column in ascending order||Unixtime timestamp in seconds|
|y||Numeric column corresponding to the data at a specified time point||-|
|minPeriod||Ratio of the minimum length of the pre-estimation period to the total length of the time series||Value range: (0, 1]|
|maxPeriod||Ratio of the maximum length of the pre-estimation period to the total length of the time series
Note The value of maxPeriod must be greater than that of minPeriod.
|Value range: (0, 1]|
|samplePeriod||Period during which the current time series data is sampled||Long type values ranging from 1 to 86399 seconds|
|sampleMethod||Method for sampling the data in the sampling window||Value range:
Statement for query and analysis:
* | select ts_period_detect(stamp, value, 0.2, 1.0, 1, 'avg') from ( select __time__ - __time__ % 120 as stamp, avg(v) as value from log GROUP BY stamp order by stamp )
|period_id||Array composed of period IDs with an array length of 1. The value 0.0 indicates the original series.|
|data_series||Result for each timestamp