diff --git a/src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md b/src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md index 5bc7d549b..f4c7e5b93 100644 --- a/src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md +++ b/src/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md @@ -409,7 +409,32 @@ You can set different datatype, encoding, and compression for the timeseries in It is also supported to set an alias, tag, and attribute for aligned timeseries. -### 2.3 Delete Timeseries +### 2.3 Modifying Timeseries Name + +Since version V2.0.8, it has been supported to modify the full path name of a timeseries through SQL statements. After a successful modification, the original name becomes invalid but is still retained in the metadata storage. + +Syntax definition: + +```sql +-- Supports modifying the full path of a certain sequence to another full path +ALTER TIMESERIES RENAME TO +``` + +Usage instructions: + +- This statement takes effect immediately upon successful execution, and the tags/attributes/alias of the original sequence will be migrated to the new sequence. +- The invalidated sequence (original sequence) no longer supports write, query, delete, or other operations. The name of the invalidated sequence will be retained by the system, and creating a new sequence with the same name is not allowed. This ensures the uniqueness and traceability of the original sequence name: it supports viewing the original sequence through the `SHOW INVALID TIMESERIES` statement, preventing the loss of original sequence information due to frequent modifications, significantly improving data traceability and problem localization efficiency. +- The new sequence does not support creating views. When modifying the encoding, compression, sequence type, tags, attributes, or alias of the new sequence, the original sequence will not be modified; deleting the new sequence will also modify the original sequence. +- If the new sequence path or the alias of the original sequence under the target device already exists (including real sequences, views, invalid sequences, and their aliases), the system will report an error. + +Usage example: + +```sql +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + + +### 2.4 Delete Timeseries To delete the timeseries we created before, we are able to use `(DELETE | DROP) TimeSeries ` statement. @@ -422,7 +447,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 Show Timeseries +### 2.5 Show Timeseries * SHOW LATEST? TIMESERIES pathPattern? whereClause? limitClause? @@ -565,8 +590,23 @@ It costs 0.004s It is worth noting that when the queried path does not exist, the system will return no timeseries. +- SHOW INVALID TIMESERIES + + Since version V2.0.8, this SQL statement is supported to display the invalidated timeseries after a successful full path name modification. + +```sql +IoTDB> show invalid timeSeries ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| NewPath| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| GORILLA| LZ4|null| null| null| null| BASE|root.newln.newwf.newwt.temperature| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +``` + +Explanation: The last column, "NewPath," in the returned result displays the new sequence corresponding to the invalidated sequence. This serves scenarios such as view construction and cluster migration (Load + rename). + -### 2.5 Count Timeseries +### 2.6 Count Timeseries IoTDB is able to use `COUNT TIMESERIES ` to count the number of timeseries matching the path. SQL statements are as follows: @@ -651,7 +691,7 @@ It costs 0.002s > Note: The path of timeseries is just a filter condition, which has no relationship with the definition of level. -### 2.6 Active Timeseries Query +### 2.7 Active Timeseries Query By adding WHERE time filter conditions to the existing SHOW/COUNT TIMESERIES, we can obtain time series with data within the specified time range. It is important to note that in metadata queries with time filters, views are not considered; only the time series actually stored in the TsFile are taken into account. @@ -691,7 +731,7 @@ IoTDB> count timeseries where time >= 15000 and time < 16000; +-----------------+ ``` Regarding the definition of active time series, data that can be queried normally is considered active, meaning time series that have been inserted but deleted are not included. -### 2.7 Tag and Attribute Management +### 2.8 Tag and Attribute Management We can also add an alias, extra tag and attribute information while creating one timeseries. diff --git a/src/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md b/src/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md index 9683a27ad..bbbe8b7ac 100644 --- a/src/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md +++ b/src/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md @@ -142,7 +142,15 @@ error: encoding TS_2DIFF does not support BOOLEAN IoTDB> CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT , longitude FLOAT) ``` -### 2.3 Delete Timeseries +### 2.3 Modify Timeseries Name + +> This statement is supported from V2.0.8 onwards + +```sql +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + +### 2.4 Delete Timeseries ```sql IoTDB> delete timeseries root.ln.wf01.wt01.status @@ -151,7 +159,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 Show Timeseries +### 2.5 Show Timeseries ```sql IoTDB> show timeseries root.** @@ -159,9 +167,12 @@ IoTDB> show timeseries root.ln.** IoTDB> show timeseries root.ln.** limit 10 offset 10 IoTDB> show timeseries root.ln.** where timeseries contains 'wf01.wt' IoTDB> show timeseries root.ln.** where dataType=FLOAT +IoTDB> show timeseries root.ln.** where time>=2017-01-01T00:00:00 and time<=2017-11-01T16:26:00 +IoTDB> show latest timeseries +IoTDB> show invalid timeseries -- This statement is supported from V2.0.8 onwards ``` -### 2.5 Count Timeseries +### 2.6 Count Timeseries ```sql IoTDB > COUNT TIMESERIES root.** @@ -178,7 +189,7 @@ IoTDB > COUNT TIMESERIES root.ln.** GROUP BY LEVEL=2 IoTDB > COUNT TIMESERIES root.ln.wf01.* GROUP BY LEVEL=2 ``` -### 2.6 Tag and Attribute Management +### 2.7 Tag and Attribute Management ```sql create timeseries root.turbine.d1.s1(temprature) with datatype=FLOAT tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2) diff --git a/src/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md b/src/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md index 0600d3919..4a6806b5e 100644 --- a/src/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md +++ b/src/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md @@ -79,12 +79,12 @@ The table below describes the types and scope of these permissions: -| Permission Name | Description | -|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| READ_DATA | Allows reading time series data under the authorized path. | -| WRITE_DATA | Allows reading time series data under the authorized path.
Allows inserting and deleting time series data under the authorized path.
Allows importing and loading data under the authorized path. When importing data, you need the WRITE_DATA permission for the corresponding path. When automatically creating databases or time series, you need MANAGE_DATABASE and WRITE_SCHEMA permissions. | -| READ_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path,
including databases, child paths, child nodes, devices, time series, templates, views, etc. | -| WRITE_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path.
Allows creating, deleting, and modifying time series, templates, views, etc. under the authorized path. When creating or modifying views, it checks the WRITE_SCHEMA permission for the view path and READ_SCHEMA permission for the data source. When querying and inserting data into views, it checks the READ_DATA and WRITE_DATA permissions for the view path.
Allows setting, unsetting, and viewing TTL under the authorized path.
Allows attaching or detaching templates under the authorized path. | +| Permission Name | Description | +|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| READ_DATA | Allows reading time series data under the authorized path. | +| WRITE_DATA | Allows reading time series data under the authorized path.
Allows inserting and deleting time series data under the authorized path.
Allows importing and loading data under the authorized path. When importing data, you need the WRITE_DATA permission for the corresponding path. When automatically creating databases or time series, you need MANAGE_DATABASE and WRITE_SCHEMA permissions. | +| READ_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path,
including databases, child paths, child nodes, devices, time series, templates, views, etc. | +| WRITE_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path.
Allows creating, deleting, and modifying time series, templates, views, etc. under the authorized path. When creating or modifying views, it checks the WRITE_SCHEMA permission for the view path and READ_SCHEMA permission for the data source. When querying and inserting data into views, it checks the READ_DATA and WRITE_DATA permissions for the view path.
Allows setting, unsetting, and viewing TTL under the authorized path.
Allows attaching or detaching templates under the authorized path.
Allowed to modify the full path name of a timeseries under an authorized path. -- Supported from V2.0.8 onwards | ### 3.2 Global Permissions diff --git a/src/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md b/src/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md index 5bc7d549b..f4c7e5b93 100644 --- a/src/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md +++ b/src/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md @@ -409,7 +409,32 @@ You can set different datatype, encoding, and compression for the timeseries in It is also supported to set an alias, tag, and attribute for aligned timeseries. -### 2.3 Delete Timeseries +### 2.3 Modifying Timeseries Name + +Since version V2.0.8, it has been supported to modify the full path name of a timeseries through SQL statements. After a successful modification, the original name becomes invalid but is still retained in the metadata storage. + +Syntax definition: + +```sql +-- Supports modifying the full path of a certain sequence to another full path +ALTER TIMESERIES RENAME TO +``` + +Usage instructions: + +- This statement takes effect immediately upon successful execution, and the tags/attributes/alias of the original sequence will be migrated to the new sequence. +- The invalidated sequence (original sequence) no longer supports write, query, delete, or other operations. The name of the invalidated sequence will be retained by the system, and creating a new sequence with the same name is not allowed. This ensures the uniqueness and traceability of the original sequence name: it supports viewing the original sequence through the `SHOW INVALID TIMESERIES` statement, preventing the loss of original sequence information due to frequent modifications, significantly improving data traceability and problem localization efficiency. +- The new sequence does not support creating views. When modifying the encoding, compression, sequence type, tags, attributes, or alias of the new sequence, the original sequence will not be modified; deleting the new sequence will also modify the original sequence. +- If the new sequence path or the alias of the original sequence under the target device already exists (including real sequences, views, invalid sequences, and their aliases), the system will report an error. + +Usage example: + +```sql +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + + +### 2.4 Delete Timeseries To delete the timeseries we created before, we are able to use `(DELETE | DROP) TimeSeries ` statement. @@ -422,7 +447,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 Show Timeseries +### 2.5 Show Timeseries * SHOW LATEST? TIMESERIES pathPattern? whereClause? limitClause? @@ -565,8 +590,23 @@ It costs 0.004s It is worth noting that when the queried path does not exist, the system will return no timeseries. +- SHOW INVALID TIMESERIES + + Since version V2.0.8, this SQL statement is supported to display the invalidated timeseries after a successful full path name modification. + +```sql +IoTDB> show invalid timeSeries ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| NewPath| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| GORILLA| LZ4|null| null| null| null| BASE|root.newln.newwf.newwt.temperature| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +``` + +Explanation: The last column, "NewPath," in the returned result displays the new sequence corresponding to the invalidated sequence. This serves scenarios such as view construction and cluster migration (Load + rename). + -### 2.5 Count Timeseries +### 2.6 Count Timeseries IoTDB is able to use `COUNT TIMESERIES ` to count the number of timeseries matching the path. SQL statements are as follows: @@ -651,7 +691,7 @@ It costs 0.002s > Note: The path of timeseries is just a filter condition, which has no relationship with the definition of level. -### 2.6 Active Timeseries Query +### 2.7 Active Timeseries Query By adding WHERE time filter conditions to the existing SHOW/COUNT TIMESERIES, we can obtain time series with data within the specified time range. It is important to note that in metadata queries with time filters, views are not considered; only the time series actually stored in the TsFile are taken into account. @@ -691,7 +731,7 @@ IoTDB> count timeseries where time >= 15000 and time < 16000; +-----------------+ ``` Regarding the definition of active time series, data that can be queried normally is considered active, meaning time series that have been inserted but deleted are not included. -### 2.7 Tag and Attribute Management +### 2.8 Tag and Attribute Management We can also add an alias, extra tag and attribute information while creating one timeseries. diff --git a/src/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md b/src/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md index 9683a27ad..bbbe8b7ac 100644 --- a/src/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md +++ b/src/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md @@ -142,7 +142,15 @@ error: encoding TS_2DIFF does not support BOOLEAN IoTDB> CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT , longitude FLOAT) ``` -### 2.3 Delete Timeseries +### 2.3 Modify Timeseries Name + +> This statement is supported from V2.0.8 onwards + +```sql +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + +### 2.4 Delete Timeseries ```sql IoTDB> delete timeseries root.ln.wf01.wt01.status @@ -151,7 +159,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 Show Timeseries +### 2.5 Show Timeseries ```sql IoTDB> show timeseries root.** @@ -159,9 +167,12 @@ IoTDB> show timeseries root.ln.** IoTDB> show timeseries root.ln.** limit 10 offset 10 IoTDB> show timeseries root.ln.** where timeseries contains 'wf01.wt' IoTDB> show timeseries root.ln.** where dataType=FLOAT +IoTDB> show timeseries root.ln.** where time>=2017-01-01T00:00:00 and time<=2017-11-01T16:26:00 +IoTDB> show latest timeseries +IoTDB> show invalid timeseries -- This statement is supported from V2.0.8 onwards ``` -### 2.5 Count Timeseries +### 2.6 Count Timeseries ```sql IoTDB > COUNT TIMESERIES root.** @@ -178,7 +189,7 @@ IoTDB > COUNT TIMESERIES root.ln.** GROUP BY LEVEL=2 IoTDB > COUNT TIMESERIES root.ln.wf01.* GROUP BY LEVEL=2 ``` -### 2.6 Tag and Attribute Management +### 2.7 Tag and Attribute Management ```sql create timeseries root.turbine.d1.s1(temprature) with datatype=FLOAT tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2) diff --git a/src/UserGuide/latest/User-Manual/Authority-Management_timecho.md b/src/UserGuide/latest/User-Manual/Authority-Management_timecho.md index 0600d3919..4a6806b5e 100644 --- a/src/UserGuide/latest/User-Manual/Authority-Management_timecho.md +++ b/src/UserGuide/latest/User-Manual/Authority-Management_timecho.md @@ -79,12 +79,12 @@ The table below describes the types and scope of these permissions: -| Permission Name | Description | -|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| READ_DATA | Allows reading time series data under the authorized path. | -| WRITE_DATA | Allows reading time series data under the authorized path.
Allows inserting and deleting time series data under the authorized path.
Allows importing and loading data under the authorized path. When importing data, you need the WRITE_DATA permission for the corresponding path. When automatically creating databases or time series, you need MANAGE_DATABASE and WRITE_SCHEMA permissions. | -| READ_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path,
including databases, child paths, child nodes, devices, time series, templates, views, etc. | -| WRITE_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path.
Allows creating, deleting, and modifying time series, templates, views, etc. under the authorized path. When creating or modifying views, it checks the WRITE_SCHEMA permission for the view path and READ_SCHEMA permission for the data source. When querying and inserting data into views, it checks the READ_DATA and WRITE_DATA permissions for the view path.
Allows setting, unsetting, and viewing TTL under the authorized path.
Allows attaching or detaching templates under the authorized path. | +| Permission Name | Description | +|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| READ_DATA | Allows reading time series data under the authorized path. | +| WRITE_DATA | Allows reading time series data under the authorized path.
Allows inserting and deleting time series data under the authorized path.
Allows importing and loading data under the authorized path. When importing data, you need the WRITE_DATA permission for the corresponding path. When automatically creating databases or time series, you need MANAGE_DATABASE and WRITE_SCHEMA permissions. | +| READ_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path,
including databases, child paths, child nodes, devices, time series, templates, views, etc. | +| WRITE_SCHEMA | Allows obtaining detailed information about the metadata tree under the authorized path.
Allows creating, deleting, and modifying time series, templates, views, etc. under the authorized path. When creating or modifying views, it checks the WRITE_SCHEMA permission for the view path and READ_SCHEMA permission for the data source. When querying and inserting data into views, it checks the READ_DATA and WRITE_DATA permissions for the view path.
Allows setting, unsetting, and viewing TTL under the authorized path.
Allows attaching or detaching templates under the authorized path.
Allowed to modify the full path name of a timeseries under an authorized path. -- Supported from V2.0.8 onwards | ### 3.2 Global Permissions diff --git a/src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md b/src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md index 529aab548..8965a0288 100644 --- a/src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md +++ b/src/zh/UserGuide/Master/Tree/Basic-Concept/Operate-Metadata_timecho.md @@ -397,7 +397,32 @@ IoTDB> CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT, longitude FLOA 对齐的时间序列也支持设置别名、标签、属性。 -### 2.3 删除时间序列 +### 2.3 修改时间序列名称 + +自 V2.0.8 版本起,支持通过 SQL 语句修改时间序列的全路径名称。修改成功后,原有名称作废,但仍在元数据的存储中。 + +语法定义: + +```SQL +-- 支持将某个序列的全路径修改为另一全路径 +ALTER TIMESERIES RENAME TO +``` + +使用说明: + +* 该语句执行成功后将立即生效,原序列的 tag/attribute/alias 将迁移到新序列。 +* 作废序列(原序列)不再支持写入、查询、删除等操作。作废后的序列名称会被系统保留,不允许创建同名新序列,以此确保原序列名称唯一可追溯:支持通过 SHOW INVALID TIMESERIES 语句查看原序列,避免因频繁修改导致原序列信息丢失,大幅提升数据溯源与问题定位效率。 +* 新序列不支持创建视图。修改新序列的编码压缩、序列类型、标签、属性、别名时,不会连带修改原序列;删除新序列时,会连带修改原序列。 +* 新序列路径或目标设备下原序列别名已存在时(包括真实序列、view、作废序列及其别名),系统会报错提示。 + +使用示例: + +```SQL +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + + +### 2.4 删除时间序列 我们可以使用`(DELETE | DROP) TimeSeries `语句来删除我们之前创建的时间序列。SQL 语句如下所示: @@ -408,7 +433,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 查看时间序列 +### 2.5 查看时间序列 * SHOW LATEST? TIMESERIES pathPattern? timeseriesWhereClause? limitClause? @@ -548,11 +573,24 @@ It costs 0.004s 表示查询出的时间序列需要按照最近插入时间戳降序排列 +需要注意的是,当查询路径不存在时,系统会返回 0 条时间序列。 +* SHOW INVALID TIMESERIES -需要注意的是,当查询路径不存在时,系统会返回 0 条时间序列。 +自 V2.0.8 版本起,支持该 SQL 语句,用于展示**修改全路径名称**成功后的作废时间序列。 + +```SQL +IoTDB> show invalid timeSeries ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| NewPath| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| GORILLA| LZ4|null| null| null| null| BASE|root.newln.newwf.newwt.temperature| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +``` + +说明:返回结果中的最后一列 `NewPath`,展示作废序列对应的新序列,以服务于视图构建、集群迁移(Load+改名)等场景。 -### 2.5 统计时间序列总数 +### 2.6 统计时间序列总数 IoTDB 支持使用`COUNT TIMESERIES`来统计一条路径中的时间序列个数。SQL 语句如下所示: @@ -639,7 +677,7 @@ It costs 0.002s > 注意:时间序列的路径只是过滤条件,与 level 的定义无关。 -### 2.6 活跃时间序列查询 +### 2.7 活跃时间序列查询 我们在原有的时间序列查询和统计上添加新的WHERE时间过滤条件,可以得到在指定时间范围中存在数据的时间序列。 需要注意的是, 在带有时间过滤的元数据查询中并不考虑视图的存在,只考虑TsFile中实际存储的时间序列。 @@ -680,7 +718,7 @@ IoTDB> count timeseries where time >= 15000 and time < 16000; ``` 关于活跃时间序列的定义,能通过正常查询查出来的数据就是活跃数据,也就是说插入但被删除的时间序列不在考虑范围内。 -### 2.7 标签点管理 +### 2.8 标签点管理 我们可以在创建时间序列的时候,为它添加别名和额外的标签和属性信息。 diff --git a/src/zh/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md b/src/zh/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md index 2e42cd67f..dff4cd080 100644 --- a/src/zh/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md +++ b/src/zh/UserGuide/Master/Tree/SQL-Manual/SQL-Manual_timecho.md @@ -72,6 +72,14 @@ create timeseries root.ln.wf02.wt02.status WITH DATATYPE=BOOLEAN CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT, longitude FLOAT) ``` +#### 修改时间序列名称 + +> V2.0.8 起支持该语句 + +```SQL +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + #### 删除时间序列 ```sql @@ -93,6 +101,7 @@ SHOW TIMESERIES root.ln.** where timeseries contains 'wf01.wt' SHOW TIMESERIES root.ln.** where dataType=FLOAT SHOW TIMESERIES root.ln.** where time>=2017-01-01T00:00:00 and time<=2017-11-01T16:26:00; SHOW LATEST TIMESERIES +SHOW INVALID TIMESERIES --V2.0.8 起支持该语句 ``` #### 统计时间序列数量 diff --git a/src/zh/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md b/src/zh/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md index 40a59f1b3..dbd0cfe67 100644 --- a/src/zh/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md +++ b/src/zh/UserGuide/Master/Tree/User-Manual/Authority-Management_timecho.md @@ -79,7 +79,7 @@ IoTDB 主要有两类权限:序列权限、全局权限。 | READ_DATA | 允许读取授权路径下的序列数据。 | | WRITE_DATA | 允许读取授权路径下的序列数据。
允许插入、删除授权路径下的的序列数据。
允许在授权路径下导入、加载数据,在导入数据时,需要拥有对应路径的 WRITE_DATA 权限,在自动创建数据库与序列时,需要有 MANAGE_DATABASE 与 WRITE_SCHEMA 权限。 | | READ_SCHEMA | 允许获取授权路径下元数据树的详细信息:
包括:路径下的数据库、子路径、子节点、设备、序列、模版、视图等。 | -| WRITE_SCHEMA | 允许获取授权路径下元数据树的详细信息。
允许在授权路径下对序列、模版、视图等进行创建、删除、修改操作。
在创建或修改 view 的时候,会检查 view 路径的 WRITE_SCHEMA 权限、数据源的 READ_SCHEMA 权限。
在对 view 进行查询、插入时,会检查 view 路径的 READ_DATA 权限、WRITE_DATA 权限。
允许在授权路径下设置、取消、查看TTL。
允许在授权路径下挂载或者接触挂载模板。 | +| WRITE_SCHEMA | 允许获取授权路径下元数据树的详细信息。
允许在授权路径下对序列、模版、视图等进行创建、删除、修改操作。
在创建或修改 view 的时候,会检查 view 路径的 WRITE_SCHEMA 权限、数据源的 READ_SCHEMA 权限。
在对 view 进行查询、插入时,会检查 view 路径的 READ_DATA 权限、WRITE_DATA 权限。
允许在授权路径下设置、取消、查看TTL。
允许在授权路径下挂载或者接触挂载模板。
允许在授权路径下对序列进行全路径名称的修改操作。//V2.0.8 起支持该功能 | ### 3.2 全局权限 diff --git a/src/zh/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md b/src/zh/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md index 529aab548..8965a0288 100644 --- a/src/zh/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md +++ b/src/zh/UserGuide/latest/Basic-Concept/Operate-Metadata_timecho.md @@ -397,7 +397,32 @@ IoTDB> CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT, longitude FLOA 对齐的时间序列也支持设置别名、标签、属性。 -### 2.3 删除时间序列 +### 2.3 修改时间序列名称 + +自 V2.0.8 版本起,支持通过 SQL 语句修改时间序列的全路径名称。修改成功后,原有名称作废,但仍在元数据的存储中。 + +语法定义: + +```SQL +-- 支持将某个序列的全路径修改为另一全路径 +ALTER TIMESERIES RENAME TO +``` + +使用说明: + +* 该语句执行成功后将立即生效,原序列的 tag/attribute/alias 将迁移到新序列。 +* 作废序列(原序列)不再支持写入、查询、删除等操作。作废后的序列名称会被系统保留,不允许创建同名新序列,以此确保原序列名称唯一可追溯:支持通过 SHOW INVALID TIMESERIES 语句查看原序列,避免因频繁修改导致原序列信息丢失,大幅提升数据溯源与问题定位效率。 +* 新序列不支持创建视图。修改新序列的编码压缩、序列类型、标签、属性、别名时,不会连带修改原序列;删除新序列时,会连带修改原序列。 +* 新序列路径或目标设备下原序列别名已存在时(包括真实序列、view、作废序列及其别名),系统会报错提示。 + +使用示例: + +```SQL +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + + +### 2.4 删除时间序列 我们可以使用`(DELETE | DROP) TimeSeries `语句来删除我们之前创建的时间序列。SQL 语句如下所示: @@ -408,7 +433,7 @@ IoTDB> delete timeseries root.ln.wf02.* IoTDB> drop timeseries root.ln.wf02.* ``` -### 2.4 查看时间序列 +### 2.5 查看时间序列 * SHOW LATEST? TIMESERIES pathPattern? timeseriesWhereClause? limitClause? @@ -548,11 +573,24 @@ It costs 0.004s 表示查询出的时间序列需要按照最近插入时间戳降序排列 +需要注意的是,当查询路径不存在时,系统会返回 0 条时间序列。 +* SHOW INVALID TIMESERIES -需要注意的是,当查询路径不存在时,系统会返回 0 条时间序列。 +自 V2.0.8 版本起,支持该 SQL 语句,用于展示**修改全路径名称**成功后的作废时间序列。 + +```SQL +IoTDB> show invalid timeSeries ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType| NewPath| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +|root.ln.wf01.wt01.temperature| null| root.ln| FLOAT| GORILLA| LZ4|null| null| null| null| BASE|root.newln.newwf.newwt.temperature| ++-----------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+----------------------------------+ +``` + +说明:返回结果中的最后一列 `NewPath`,展示作废序列对应的新序列,以服务于视图构建、集群迁移(Load+改名)等场景。 -### 2.5 统计时间序列总数 +### 2.6 统计时间序列总数 IoTDB 支持使用`COUNT TIMESERIES`来统计一条路径中的时间序列个数。SQL 语句如下所示: @@ -639,7 +677,7 @@ It costs 0.002s > 注意:时间序列的路径只是过滤条件,与 level 的定义无关。 -### 2.6 活跃时间序列查询 +### 2.7 活跃时间序列查询 我们在原有的时间序列查询和统计上添加新的WHERE时间过滤条件,可以得到在指定时间范围中存在数据的时间序列。 需要注意的是, 在带有时间过滤的元数据查询中并不考虑视图的存在,只考虑TsFile中实际存储的时间序列。 @@ -680,7 +718,7 @@ IoTDB> count timeseries where time >= 15000 and time < 16000; ``` 关于活跃时间序列的定义,能通过正常查询查出来的数据就是活跃数据,也就是说插入但被删除的时间序列不在考虑范围内。 -### 2.7 标签点管理 +### 2.8 标签点管理 我们可以在创建时间序列的时候,为它添加别名和额外的标签和属性信息。 diff --git a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md index 2e42cd67f..dff4cd080 100644 --- a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md +++ b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual_timecho.md @@ -72,6 +72,14 @@ create timeseries root.ln.wf02.wt02.status WITH DATATYPE=BOOLEAN CREATE ALIGNED TIMESERIES root.ln.wf01.GPS(latitude FLOAT, longitude FLOAT) ``` +#### 修改时间序列名称 + +> V2.0.8 起支持该语句 + +```SQL +ALTER TIMESERIES root.ln.wf01.wt01.temperature RENAME TO root.newln.newwf.newwt.temperature +``` + #### 删除时间序列 ```sql @@ -93,6 +101,7 @@ SHOW TIMESERIES root.ln.** where timeseries contains 'wf01.wt' SHOW TIMESERIES root.ln.** where dataType=FLOAT SHOW TIMESERIES root.ln.** where time>=2017-01-01T00:00:00 and time<=2017-11-01T16:26:00; SHOW LATEST TIMESERIES +SHOW INVALID TIMESERIES --V2.0.8 起支持该语句 ``` #### 统计时间序列数量 diff --git a/src/zh/UserGuide/latest/User-Manual/Authority-Management_timecho.md b/src/zh/UserGuide/latest/User-Manual/Authority-Management_timecho.md index 40a59f1b3..dbd0cfe67 100644 --- a/src/zh/UserGuide/latest/User-Manual/Authority-Management_timecho.md +++ b/src/zh/UserGuide/latest/User-Manual/Authority-Management_timecho.md @@ -79,7 +79,7 @@ IoTDB 主要有两类权限:序列权限、全局权限。 | READ_DATA | 允许读取授权路径下的序列数据。 | | WRITE_DATA | 允许读取授权路径下的序列数据。
允许插入、删除授权路径下的的序列数据。
允许在授权路径下导入、加载数据,在导入数据时,需要拥有对应路径的 WRITE_DATA 权限,在自动创建数据库与序列时,需要有 MANAGE_DATABASE 与 WRITE_SCHEMA 权限。 | | READ_SCHEMA | 允许获取授权路径下元数据树的详细信息:
包括:路径下的数据库、子路径、子节点、设备、序列、模版、视图等。 | -| WRITE_SCHEMA | 允许获取授权路径下元数据树的详细信息。
允许在授权路径下对序列、模版、视图等进行创建、删除、修改操作。
在创建或修改 view 的时候,会检查 view 路径的 WRITE_SCHEMA 权限、数据源的 READ_SCHEMA 权限。
在对 view 进行查询、插入时,会检查 view 路径的 READ_DATA 权限、WRITE_DATA 权限。
允许在授权路径下设置、取消、查看TTL。
允许在授权路径下挂载或者接触挂载模板。 | +| WRITE_SCHEMA | 允许获取授权路径下元数据树的详细信息。
允许在授权路径下对序列、模版、视图等进行创建、删除、修改操作。
在创建或修改 view 的时候,会检查 view 路径的 WRITE_SCHEMA 权限、数据源的 READ_SCHEMA 权限。
在对 view 进行查询、插入时,会检查 view 路径的 READ_DATA 权限、WRITE_DATA 权限。
允许在授权路径下设置、取消、查看TTL。
允许在授权路径下挂载或者接触挂载模板。
允许在授权路径下对序列进行全路径名称的修改操作。//V2.0.8 起支持该功能 | ### 3.2 全局权限