From 8d510fcf1873124df8ed2464789bc16e615d2533 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 28 Sep 2022 17:28:23 +0800 Subject: [PATCH 1/3] add _irowts in EN doc --- docs/en/12-taos-sql/06-select.md | 8 ++++++++ docs/en/12-taos-sql/20-keywords.md | 1 + docs/en/12-taos-sql/29-changes.md | 13 +++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 786444ad77..1271e262ab 100644 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -181,6 +181,14 @@ In TDengine, the first column of all tables must be a timestamp. This column is select _rowts, max(current) from meters; ``` +**\_IROWTS** + +The \_IROWTS pseudocolumns can only be used with INTERP FUNCTION. This pseudocolumns can be used to retrieve the corresponding timestamp column associated with the INTERPOLATION results. + +```sql +select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); +``` + ## Query Objects `FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query. diff --git a/docs/en/12-taos-sql/20-keywords.md b/docs/en/12-taos-sql/20-keywords.md index f7eb067c96..4b479b866b 100644 --- a/docs/en/12-taos-sql/20-keywords.md +++ b/docs/en/12-taos-sql/20-keywords.md @@ -343,6 +343,7 @@ The following list shows all reserved keywords: ### \_ - \_C0 +- \_IROWTS - \_QDURATION - \_QEND - \_QSTART diff --git a/docs/en/12-taos-sql/29-changes.md b/docs/en/12-taos-sql/29-changes.md index 8532eeac5d..78b6d5fc05 100644 --- a/docs/en/12-taos-sql/29-changes.md +++ b/docs/en/12-taos-sql/29-changes.md @@ -11,12 +11,13 @@ description: "This document explains how TDengine SQL has changed in version 3.0 | 1 | VARCHAR | Added | Alias of BINARY. | 2 | TIMESTAMP literal | Added | TIMESTAMP 'timestamp format' syntax now supported. | 3 | _ROWTS pseudocolumn | Added | Indicates the primary key. Alias of _C0. -| 4 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions -| 5 | PERFORMANCE_SCHEMA | Added | Database for system performance information. -| 6 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated. -| 7 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses. -| 8 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns. -| 9 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline. +| 4 | _IROWTS pseudocolumn | Added | Used to retrieve timestamps with INTERP function. +| 5 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions +| 6 | PERFORMANCE_SCHEMA | Added | Database for system performance information. +| 7 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated. +| 8 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses. +| 9 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns. +| 10 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline. ## SQL Syntax From dd59a04963ce18296cb8ec8a044d8b65d3ef059d Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 28 Sep 2022 17:28:55 +0800 Subject: [PATCH 2/3] add _irowts in Docs zh --- docs/zh/12-taos-sql/06-select.md | 8 ++++++++ docs/zh/12-taos-sql/20-keywords.md | 1 + docs/zh/12-taos-sql/29-changes.md | 13 +++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/zh/12-taos-sql/06-select.md b/docs/zh/12-taos-sql/06-select.md index 394e4a99d5..b3b8ef3887 100644 --- a/docs/zh/12-taos-sql/06-select.md +++ b/docs/zh/12-taos-sql/06-select.md @@ -182,6 +182,14 @@ TDengine 中,所有表的第一列都必须是时间戳类型,且为其主 select _rowts, max(current) from meters; ``` +**\_IROWTS** + +\_irowts 伪列只能与 interp 函数一起使用,用于返回 interp 函数插值结果对应的时间戳列。 + +```sql +select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear); +``` + ## 查询对象 FROM 关键字后面可以是若干个表(超级表)列表,也可以是子查询的结果。 diff --git a/docs/zh/12-taos-sql/20-keywords.md b/docs/zh/12-taos-sql/20-keywords.md index 7530e803db..8013698fce 100644 --- a/docs/zh/12-taos-sql/20-keywords.md +++ b/docs/zh/12-taos-sql/20-keywords.md @@ -344,6 +344,7 @@ description: TDengine 保留关键字的详细列表 ### \_ - \_C0 +- \_IROWTS - \_QDURATION - \_QEND - \_QSTART diff --git a/docs/zh/12-taos-sql/29-changes.md b/docs/zh/12-taos-sql/29-changes.md index e63825045d..7da8e9f331 100644 --- a/docs/zh/12-taos-sql/29-changes.md +++ b/docs/zh/12-taos-sql/29-changes.md @@ -11,12 +11,13 @@ description: "TDengine 3.0 版本的语法变更说明" | 1 | VARCHAR | 新增 | BINARY类型的别名。 | 2 | TIMESTAMP字面量 | 新增 | 新增支持 TIMESTAMP 'timestamp format' 语法。 | 3 | _ROWTS伪列 | 新增 | 表示时间戳主键。是_C0伪列的别名。 -| 4 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。 -| 5 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。 -| 6 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。 -| 7 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。 -| 8 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。 -| 9 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。 +| 4 | _IROWTS伪列 | 新增 | 用于返回 interp 函数插值结果对应的时间戳列。 +| 5 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。 +| 6 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。 +| 7 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。 +| 8 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。 +| 9 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。 +| 10 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。 ## SQL 语句变更 From 65779d041cf21357daf378f3488741eedce5b623 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Wed, 28 Sep 2022 17:35:57 +0800 Subject: [PATCH 3/3] fix grammer --- docs/en/12-taos-sql/06-select.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/12-taos-sql/06-select.md b/docs/en/12-taos-sql/06-select.md index 1271e262ab..c065245827 100644 --- a/docs/en/12-taos-sql/06-select.md +++ b/docs/en/12-taos-sql/06-select.md @@ -183,7 +183,7 @@ select _rowts, max(current) from meters; **\_IROWTS** -The \_IROWTS pseudocolumns can only be used with INTERP FUNCTION. This pseudocolumns can be used to retrieve the corresponding timestamp column associated with the INTERPOLATION results. +The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolumn can be used to retrieve the corresponding timestamp column associated with the interpolation results. ```sql select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear);