Time Series Processing

CHANGE_POINTS

Usage

This function is used to remove consecutive identical values from an input sequence. For example, input:1,1,2,2,3 output:1,2,3.

Name: CHANGE_POINTS

Input Series: Support only one input series.

Parameters: No parameters.

Example

Raw data:

  1. +-----------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+
  2. | Time|root.testChangePoints.d1.s1|root.testChangePoints.d1.s2|root.testChangePoints.d1.s3|root.testChangePoints.d1.s4|root.testChangePoints.d1.s5|root.testChangePoints.d1.s6|
  3. +-----------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+
  4. |1970-01-01T08:00:00.001+08:00| true| 1| 1| 1.0| 1.0| 1test1|
  5. |1970-01-01T08:00:00.002+08:00| true| 2| 2| 2.0| 1.0| 2test2|
  6. |1970-01-01T08:00:00.003+08:00| false| 1| 2| 1.0| 1.0| 2test2|
  7. |1970-01-01T08:00:00.004+08:00| true| 1| 3| 1.0| 1.0| 1test1|
  8. |1970-01-01T08:00:00.005+08:00| true| 1| 3| 1.0| 1.0| 1test1|
  9. +-----------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+---------------------------+

SQL for query:

  1. select change_points(s1), change_points(s2), change_points(s3), change_points(s4), change_points(s5), change_points(s6) from root.testChangePoints.d1

Output series:

  1. +-----------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
  2. | Time|change_points(root.testChangePoints.d1.s1)|change_points(root.testChangePoints.d1.s2)|change_points(root.testChangePoints.d1.s3)|change_points(root.testChangePoints.d1.s4)|change_points(root.testChangePoints.d1.s5)|change_points(root.testChangePoints.d1.s6)|
  3. +-----------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+
  4. |1970-01-01T08:00:00.001+08:00| true| 1| 1| 1.0| 1.0| 1test1|
  5. |1970-01-01T08:00:00.002+08:00| null| 2| 2| 2.0| null| 2test2|
  6. |1970-01-01T08:00:00.003+08:00| false| 1| null| 1.0| null| null|
  7. |1970-01-01T08:00:00.004+08:00| true| null| 3| null| null| 1test1|
  8. +-----------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+------------------------------------------+