Data Quality

Completeness

Usage

This function is used to calculate the completeness of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the completeness of each window will be output.

Name: COMPLETENESS

Input Series: Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • window: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is ‘ms’ for millisecond, ‘s’ for second, ‘m’ for minute, ‘h’ for hour and ‘d’ for day. By default, all input data belongs to the same window.
  • downtime: Whether the downtime exception is considered in the calculation of completeness. It is ‘true’ or ‘false’ (default). When considering the downtime exception, long-term missing data will be considered as downtime exception without any influence on completeness.

Output Series: Output a single series. The type is DOUBLE. The range of each value is [0,1].

Note: Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.

Examples

Default Parameters

With default parameters, this function will regard all input data as the same window.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. +-----------------------------+---------------+

SQL for query:

  1. select completeness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30

Output series:

  1. +-----------------------------+-----------------------------+
  2. | Time|completeness(root.test.d1.s1)|
  3. +-----------------------------+-----------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.875|
  5. +-----------------------------+-----------------------------+

Specific Window Size

When the window size is given, this function will divide the input data as multiple windows.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. |2020-01-01T00:00:32.000+08:00| 130.0|
  20. |2020-01-01T00:00:34.000+08:00| 132.0|
  21. |2020-01-01T00:00:36.000+08:00| 134.0|
  22. |2020-01-01T00:00:38.000+08:00| 136.0|
  23. |2020-01-01T00:00:40.000+08:00| 138.0|
  24. |2020-01-01T00:00:42.000+08:00| 140.0|
  25. |2020-01-01T00:00:44.000+08:00| 142.0|
  26. |2020-01-01T00:00:46.000+08:00| 144.0|
  27. |2020-01-01T00:00:48.000+08:00| 146.0|
  28. |2020-01-01T00:00:50.000+08:00| 148.0|
  29. |2020-01-01T00:00:52.000+08:00| 150.0|
  30. |2020-01-01T00:00:54.000+08:00| 152.0|
  31. |2020-01-01T00:00:56.000+08:00| 154.0|
  32. |2020-01-01T00:00:58.000+08:00| 156.0|
  33. |2020-01-01T00:01:00.000+08:00| 158.0|
  34. +-----------------------------+---------------+

SQL for query:

  1. select completeness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00

Output series:

  1. +-----------------------------+--------------------------------------------+
  2. | Time|completeness(root.test.d1.s1, "window"="15")|
  3. +-----------------------------+--------------------------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.875|
  5. |2020-01-01T00:00:32.000+08:00| 1.0|
  6. +-----------------------------+--------------------------------------------+

Consistency

Usage

This function is used to calculate the consistency of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the consistency of each window will be output.

Name: CONSISTENCY

Input Series: Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • window: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is ‘ms’ for millisecond, ‘s’ for second, ‘m’ for minute, ‘h’ for hour and ‘d’ for day. By default, all input data belongs to the same window.

Output Series: Output a single series. The type is DOUBLE. The range of each value is [0,1].

Note: Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.

Examples

Default Parameters

With default parameters, this function will regard all input data as the same window.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. +-----------------------------+---------------+

SQL for query:

  1. select consistency(s1) from root.test.d1 where time <= 2020-01-01 00:00:30

Output series:

  1. +-----------------------------+----------------------------+
  2. | Time|consistency(root.test.d1.s1)|
  3. +-----------------------------+----------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.9333333333333333|
  5. +-----------------------------+----------------------------+

Specific Window Size

When the window size is given, this function will divide the input data as multiple windows.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. |2020-01-01T00:00:32.000+08:00| 130.0|
  20. |2020-01-01T00:00:34.000+08:00| 132.0|
  21. |2020-01-01T00:00:36.000+08:00| 134.0|
  22. |2020-01-01T00:00:38.000+08:00| 136.0|
  23. |2020-01-01T00:00:40.000+08:00| 138.0|
  24. |2020-01-01T00:00:42.000+08:00| 140.0|
  25. |2020-01-01T00:00:44.000+08:00| 142.0|
  26. |2020-01-01T00:00:46.000+08:00| 144.0|
  27. |2020-01-01T00:00:48.000+08:00| 146.0|
  28. |2020-01-01T00:00:50.000+08:00| 148.0|
  29. |2020-01-01T00:00:52.000+08:00| 150.0|
  30. |2020-01-01T00:00:54.000+08:00| 152.0|
  31. |2020-01-01T00:00:56.000+08:00| 154.0|
  32. |2020-01-01T00:00:58.000+08:00| 156.0|
  33. |2020-01-01T00:01:00.000+08:00| 158.0|
  34. +-----------------------------+---------------+

SQL for query:

  1. select consistency(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00

Output series:

  1. +-----------------------------+-------------------------------------------+
  2. | Time|consistency(root.test.d1.s1, "window"="15")|
  3. +-----------------------------+-------------------------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.9333333333333333|
  5. |2020-01-01T00:00:32.000+08:00| 1.0|
  6. +-----------------------------+-------------------------------------------+

Timeliness

Usage

This function is used to calculate the timeliness of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the timeliness of each window will be output.

Name: TIMELINESS

Input Series: Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • window: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is ‘ms’ for millisecond, ‘s’ for second, ‘m’ for minute, ‘h’ for hour and ‘d’ for day. By default, all input data belongs to the same window.

Output Series: Output a single series. The type is DOUBLE. The range of each value is [0,1].

Note: Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.

Examples

Default Parameters

With default parameters, this function will regard all input data as the same window.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. +-----------------------------+---------------+

SQL for query:

  1. select timeliness(s1) from root.test.d1 where time <= 2020-01-01 00:00:30

Output series:

  1. +-----------------------------+---------------------------+
  2. | Time|timeliness(root.test.d1.s1)|
  3. +-----------------------------+---------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.9333333333333333|
  5. +-----------------------------+---------------------------+

Specific Window Size

When the window size is given, this function will divide the input data as multiple windows.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. |2020-01-01T00:00:32.000+08:00| 130.0|
  20. |2020-01-01T00:00:34.000+08:00| 132.0|
  21. |2020-01-01T00:00:36.000+08:00| 134.0|
  22. |2020-01-01T00:00:38.000+08:00| 136.0|
  23. |2020-01-01T00:00:40.000+08:00| 138.0|
  24. |2020-01-01T00:00:42.000+08:00| 140.0|
  25. |2020-01-01T00:00:44.000+08:00| 142.0|
  26. |2020-01-01T00:00:46.000+08:00| 144.0|
  27. |2020-01-01T00:00:48.000+08:00| 146.0|
  28. |2020-01-01T00:00:50.000+08:00| 148.0|
  29. |2020-01-01T00:00:52.000+08:00| 150.0|
  30. |2020-01-01T00:00:54.000+08:00| 152.0|
  31. |2020-01-01T00:00:56.000+08:00| 154.0|
  32. |2020-01-01T00:00:58.000+08:00| 156.0|
  33. |2020-01-01T00:01:00.000+08:00| 158.0|
  34. +-----------------------------+---------------+

SQL for query:

  1. select timeliness(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00

Output series:

  1. +-----------------------------+------------------------------------------+
  2. | Time|timeliness(root.test.d1.s1, "window"="15")|
  3. +-----------------------------+------------------------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.9333333333333333|
  5. |2020-01-01T00:00:32.000+08:00| 1.0|
  6. +-----------------------------+------------------------------------------+

Validity

Usage

This function is used to calculate the Validity of time series. The input series are divided into several continuous and non overlapping windows. The timestamp of the first data point and the Validity of each window will be output.

Name: VALIDITY

Input Series: Only support a single input series. The type is INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • window: The size of each window. It is a positive integer or a positive number with an unit. The former is the number of data points in each window. The number of data points in the last window may be less than it. The latter is the time of the window. The unit is ‘ms’ for millisecond, ‘s’ for second, ‘m’ for minute, ‘h’ for hour and ‘d’ for day. By default, all input data belongs to the same window.

Output Series: Output a single series. The type is DOUBLE. The range of each value is [0,1].

Note: Only when the number of data points in the window exceeds 10, the calculation will be performed. Otherwise, the window will be ignored and nothing will be output.

Examples

Default Parameters

With default parameters, this function will regard all input data as the same window.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. +-----------------------------+---------------+

SQL for query:

  1. select Validity(s1) from root.test.d1 where time <= 2020-01-01 00:00:30

Output series:

  1. +-----------------------------+-------------------------+
  2. | Time|validity(root.test.d1.s1)|
  3. +-----------------------------+-------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.8833333333333333|
  5. +-----------------------------+-------------------------+

Specific Window Size

When the window size is given, this function will divide the input data as multiple windows.

Input series:

  1. +-----------------------------+---------------+
  2. | Time|root.test.d1.s1|
  3. +-----------------------------+---------------+
  4. |2020-01-01T00:00:02.000+08:00| 100.0|
  5. |2020-01-01T00:00:03.000+08:00| 101.0|
  6. |2020-01-01T00:00:04.000+08:00| 102.0|
  7. |2020-01-01T00:00:06.000+08:00| 104.0|
  8. |2020-01-01T00:00:08.000+08:00| 126.0|
  9. |2020-01-01T00:00:10.000+08:00| 108.0|
  10. |2020-01-01T00:00:14.000+08:00| 112.0|
  11. |2020-01-01T00:00:15.000+08:00| 113.0|
  12. |2020-01-01T00:00:16.000+08:00| 114.0|
  13. |2020-01-01T00:00:18.000+08:00| 116.0|
  14. |2020-01-01T00:00:20.000+08:00| 118.0|
  15. |2020-01-01T00:00:22.000+08:00| 120.0|
  16. |2020-01-01T00:00:26.000+08:00| 124.0|
  17. |2020-01-01T00:00:28.000+08:00| 126.0|
  18. |2020-01-01T00:00:30.000+08:00| NaN|
  19. |2020-01-01T00:00:32.000+08:00| 130.0|
  20. |2020-01-01T00:00:34.000+08:00| 132.0|
  21. |2020-01-01T00:00:36.000+08:00| 134.0|
  22. |2020-01-01T00:00:38.000+08:00| 136.0|
  23. |2020-01-01T00:00:40.000+08:00| 138.0|
  24. |2020-01-01T00:00:42.000+08:00| 140.0|
  25. |2020-01-01T00:00:44.000+08:00| 142.0|
  26. |2020-01-01T00:00:46.000+08:00| 144.0|
  27. |2020-01-01T00:00:48.000+08:00| 146.0|
  28. |2020-01-01T00:00:50.000+08:00| 148.0|
  29. |2020-01-01T00:00:52.000+08:00| 150.0|
  30. |2020-01-01T00:00:54.000+08:00| 152.0|
  31. |2020-01-01T00:00:56.000+08:00| 154.0|
  32. |2020-01-01T00:00:58.000+08:00| 156.0|
  33. |2020-01-01T00:01:00.000+08:00| 158.0|
  34. +-----------------------------+---------------+

SQL for query:

  1. select Validity(s1,"window"="15") from root.test.d1 where time <= 2020-01-01 00:01:00

Output series:

  1. +-----------------------------+----------------------------------------+
  2. | Time|validity(root.test.d1.s1, "window"="15")|
  3. +-----------------------------+----------------------------------------+
  4. |2020-01-01T00:00:02.000+08:00| 0.8833333333333333|
  5. |2020-01-01T00:00:32.000+08:00| 1.0|
  6. +-----------------------------+----------------------------------------+

Accuracy

Usage

This function is used to calculate the Accuracy of time series based on master data.

Name: Accuracy

Input Series: Support multiple input series. The types are are in INT32 / INT64 / FLOAT / DOUBLE.

Parameters:

  • omega: The window size. It is a non-negative integer whose unit is millisecond. By default, it will be estimated according to the distances of two tuples with various time differences.
  • eta: The distance threshold. It is a positive number. By default, it will be estimated according to the distance distribution of tuples in windows.
  • k: The number of neighbors in master data. It is a positive integer. By default, it will be estimated according to the tuple dis- tance of the k-th nearest neighbor in the master data.

Output Series: Output a single value. The type is DOUBLE. The range is [0,1].

Examples

Input series:

  1. +-----------------------------+------------+------------+------------+------------+------------+------------+
  2. | Time|root.test.t1|root.test.t2|root.test.t3|root.test.m1|root.test.m2|root.test.m3|
  3. +-----------------------------+------------+------------+------------+------------+------------+------------+
  4. |2021-07-01T12:00:01.000+08:00| 1704| 1154.55| 0.195| 1704| 1154.55| 0.195|
  5. |2021-07-01T12:00:02.000+08:00| 1702| 1152.30| 0.193| 1702| 1152.30| 0.193|
  6. |2021-07-01T12:00:03.000+08:00| 1702| 1148.65| 0.192| 1702| 1148.65| 0.192|
  7. |2021-07-01T12:00:04.000+08:00| 1701| 1145.20| 0.194| 1701| 1145.20| 0.194|
  8. |2021-07-01T12:00:07.000+08:00| 1703| 1150.55| 0.195| 1703| 1150.55| 0.195|
  9. |2021-07-01T12:00:08.000+08:00| 1694| 1151.55| 0.193| 1704| 1151.55| 0.193|
  10. |2021-07-01T12:01:09.000+08:00| 1705| 1153.55| 0.194| 1705| 1153.55| 0.194|
  11. |2021-07-01T12:01:10.000+08:00| 1706| 1152.30| 0.190| 1706| 1152.30| 0.190|
  12. +-----------------------------+------------+------------+------------+------------+------------+------------+

SQL for query:

  1. select Accuracy(t1,t2,t3,m1,m2,m3) from root.test

Output series:

  1. +-----------------------------+---------------------------------------------------------------------------------------+
  2. | Time|Accuracy(root.test.t1,root.test.t2,root.test.t3,root.test.m1,root.test.m2,root.test.m3)|
  3. +-----------------------------+---------------------------------------------------------------------------------------+
  4. |2021-07-01T12:00:01.000+08:00| 0.875|
  5. +-----------------------------+---------------------------------------------------------------------------------------+