From 98b6d607d88fa985743f106f860474fbd381e327 Mon Sep 17 00:00:00 2001 From: Chait Diwadkar <94201190+cdiwadkar16@users.noreply.github.com> Date: Sat, 11 Feb 2023 09:07:12 -0800 Subject: [PATCH] docs:cdiwadkar16-patch-1 - example for INTERP Added an example for INTERP functions using the smart meters demo --- docs/en/12-taos-sql/10-function.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/en/12-taos-sql/10-function.md b/docs/en/12-taos-sql/10-function.md index d2aca5c361..165285df81 100644 --- a/docs/en/12-taos-sql/10-function.md +++ b/docs/en/12-taos-sql/10-function.md @@ -880,6 +880,15 @@ INTERP(expr) - Pseudocolumn `_irowts` can be used along with `INTERP` to return the timestamps associated with interpolation points(support after version 3.0.1.4). - Pseudocolumn `_isfilled` can be used along with `INTERP` to indicate whether the results are original records or data points generated by interpolation algorithm(support after version 3.0.2.3). +**Example** + +- We use the smart meters example used in this documentation to illustrate how to use the INTERP function. +- We want to downsample every 1 hour and use a linear fill for missing values. Note the order in which the "partition by" clause and the "range", "every" and "fill" parameters are used. + +```sql +SELECT _irowts,INTERP(current) FROM test.meters PARTITION BY TBNAME RANGE('2017-07-22 00:00:00','2017-07-24 12:25:00') EVERY(1h) FILL(LINEAR) +``` + ### LAST ```sql -- GitLab