Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,49 @@ SHOW DATABASES DETAILS;
+------------------+-------+-----------------------+---------------------+---------------------+--------------------+-----------------------+------------------+---------------------+
```

### 2.5 Count Databases
### 2.5 View Database Creation Information

Use this statement to obtain the `CREATE DATABASE` statement for a specified table-model database. This feature is supported since V2.0.12.

**Syntax:**

```SQL
SHOW CREATE DATABASE <DATABASE_NAME>;
```

**Result:**

| **Column Name** | **Type** | **Description** |
| :---------------- | :------- | :----------------------------------------------------------------------------- |
| Database | TEXT | Database name. |
| Create Database | TEXT | A `CREATE DATABASE` statement that can be used to recreate the database. |

**Notes:**

1. The system database `information_schema` is not supported. Permission checks are the same as those for viewing or using a database.
2. The database name in the returned statement is always enclosed in double quotation marks.
3. When TTL is infinite, the output is `INF`; when TTL is finite, the numeric value is output. `time_partition_interval`, `max_schema_region_group_num`, and `max_data_region_group_num` use their effective values.
4. If the database does not exist, the statement returns an `Unknown database <database>` error.

**Example:**

View the creation information for the existing database `database1`:

```SQL
SHOW CREATE DATABASE database1;
```

Result:

```SQL
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Database| Create Database|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
|database1|CREATE DATABASE "database1" WITH (ttl=31536000000,time_partition_interval=604800000,max_schema_region_group_num=1,max_data_region_group_num=7)|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
```

### 2.6 Count Databases

Counts the total number of databases. This syntax is supported starting from V2.0.11.

Expand All @@ -187,7 +229,7 @@ TimechoDB> COUNT DATABASES
+-----+
```

### 2.6 Update a Database
### 2.7 Update a Database

Modifies supported database properties.

Expand All @@ -208,7 +250,7 @@ ALTER DATABASE database1 SET PROPERTIES TTL=31536000000;
ALTER DATABASE database1 SET PROPERTIES MAX_SCHEMA_REGION_GROUP_NUM=2, MAX_DATA_REGION_GROUP_NUM=4;
```

### 2.7 Delete a Database
### 2.8 Delete a Database

Deletes a database.

Expand Down
47 changes: 45 additions & 2 deletions src/UserGuide/Master/Table/User-Manual/Data-Sync_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,50 @@ IoTDB> show pipe alldatapipe_realtime
```


### 2.6 Modify a Task
### 2.6 View Task Creation Information

Use this statement to obtain the creation statement for a specified synchronization task. This feature is supported since V2.0.12.

**Syntax:**

```SQL
SHOW CREATE PIPE <PipeId>;
```

**Result:**

| **Column Name** | **Type** | **Description** |
| :-------------- | :------- | :----------------------------------------------------------------------------- |
| Pipe | TEXT | Synchronization task name. |
| Create Pipe | TEXT | A `CREATE PIPE` statement that can be used to recreate the static task definition. |

**Notes:**

1. Only Pipes visible to the table model are returned. If the task does not exist or is not visible to the current user, a task-not-found or permission-related error is returned.
2. The Pipe name is always enclosed in double quotation marks. Property names and values are output as string literals, with single quotation marks escaped; properties are sorted stably by property name.
3. If `WITH SOURCE`, `WITH PROCESSOR`, or `WITH SINK` has no user-visible properties, the corresponding clause is omitted.
4. Properties with the `__system` or `__audit` prefix and system-injected authentication context are omitted. User-configured authentication properties required to recreate connection semantics are retained.
5. Only the static task definition is returned; runtime state, historical errors, remaining event count, and transmission progress are not included.

**Example:**

View the creation information for the existing task `table1_pipe_realtime`:

```SQL
SHOW CREATE PIPE table1_pipe_realtime;
```

Result:

```text
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Pipe| Create Pipe|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1_pipe_realtime|CREATE PIPE "table1_pipe_realtime" WITH SOURCE ('database-name'='database1','end-time'='2024-11-28T11:00:00+08:00','history.enable'='false','mode.strict'='true','realtime.enable'='true','start-time'='2024-11-28T08:00:00+08:00','table-name'='table1') WITH SINK ('sink'='do-nothing-sink')|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

### 2.7 Modify a Task

The `ALTER PIPE` statement dynamically updates an existing PIPE and supports modifying or replacing the configuration of source, processor, and sink.

Expand All @@ -257,7 +300,7 @@ Example:
ALTER PIPE A2B REPLACE SINK ('sink'='iotdb-thrift-sink', 'node-urls' = '127.0.0.1:6668');
```

### 2.7 Synchronization Plugins
### 2.8 Synchronization Plugins

To make the architecture more flexible and adaptable to different synchronization scenarios, IoTDB supports plugin assembly in the synchronization task framework. The system provides some common pre-installed plugins, and you can also customize `processor` and `sink` plugins and load them into the IoTDB system.

Expand Down
2 changes: 2 additions & 0 deletions src/UserGuide/Master/Tree/User-Manual/Data-Sync_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ By declaratively configuring the specific content of the three parts through SQL

1. The schema and auth synchronization functions have the following limitations:

- Since V2.0.12, the time series name at the sender can be modified after synchronization is established, and the synchronization link continues to run normally after the modification.

- When using schema synchronization, it is required that the consensus protocol for `Schema region` and `ConfigNode` must be the default ratis protocol. This means that the `iotdb-system.properties` configuration file should contain the settings `config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus` and `schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus`. If these are not specified, the default ratis protocol is used.

- To prevent potential conflicts, please disable the automatic creation of schema on the receiving end when enabling schema synchronization. This can be done by setting the `enable_auto_create_schema` configuration in the `iotdb-system.properties` file to false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,49 @@ SHOW DATABASES DETAILS;
+------------------+-------+-----------------------+---------------------+---------------------+--------------------+-----------------------+------------------+---------------------+
```

### 2.5 Count Databases
### 2.5 View Database Creation Information

Use this statement to obtain the `CREATE DATABASE` statement for a specified table-model database. This feature is supported since V2.0.12.

**Syntax:**

```SQL
SHOW CREATE DATABASE <DATABASE_NAME>;
```

**Result:**

| **Column Name** | **Type** | **Description** |
| :---------------- | :------- | :----------------------------------------------------------------------------- |
| Database | TEXT | Database name. |
| Create Database | TEXT | A `CREATE DATABASE` statement that can be used to recreate the database. |

**Notes:**

1. The system database `information_schema` is not supported. Permission checks are the same as those for viewing or using a database.
2. The database name in the returned statement is always enclosed in double quotation marks.
3. When TTL is infinite, the output is `INF`; when TTL is finite, the numeric value is output. `time_partition_interval`, `max_schema_region_group_num`, and `max_data_region_group_num` use their effective values.
4. If the database does not exist, the statement returns an `Unknown database <database>` error.

**Example:**

View the creation information for the existing database `database1`:

```SQL
SHOW CREATE DATABASE database1;
```

Result:

```SQL
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Database| Create Database|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
|database1|CREATE DATABASE "database1" WITH (ttl=31536000000,time_partition_interval=604800000,max_schema_region_group_num=1,max_data_region_group_num=7)|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
```

### 2.6 Count Databases

Counts the total number of databases. This syntax is supported starting from V2.0.11.

Expand All @@ -187,7 +229,7 @@ TimechoDB> COUNT DATABASES
+-----+
```

### 2.6 Update a Database
### 2.7 Update a Database

Modifies supported database properties.

Expand All @@ -208,7 +250,7 @@ ALTER DATABASE database1 SET PROPERTIES TTL=31536000000;
ALTER DATABASE database1 SET PROPERTIES MAX_SCHEMA_REGION_GROUP_NUM=2, MAX_DATA_REGION_GROUP_NUM=4;
```

### 2.7 Delete a Database
### 2.8 Delete a Database

Deletes a database.

Expand Down
47 changes: 45 additions & 2 deletions src/UserGuide/latest-Table/User-Manual/Data-Sync_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,50 @@ IoTDB> show pipe alldatapipe_realtime
```


### 2.6 Modify a Task
### 2.6 View Task Creation Information

Use this statement to obtain the creation statement for a specified synchronization task. This feature is supported since V2.0.12.

**Syntax:**

```SQL
SHOW CREATE PIPE <PipeId>;
```

**Result:**

| **Column Name** | **Type** | **Description** |
| :-------------- | :------- | :----------------------------------------------------------------------------- |
| Pipe | TEXT | Synchronization task name. |
| Create Pipe | TEXT | A `CREATE PIPE` statement that can be used to recreate the static task definition. |

**Notes:**

1. Only Pipes visible to the table model are returned. If the task does not exist or is not visible to the current user, a task-not-found or permission-related error is returned.
2. The Pipe name is always enclosed in double quotation marks. Property names and values are output as string literals, with single quotation marks escaped; properties are sorted stably by property name.
3. If `WITH SOURCE`, `WITH PROCESSOR`, or `WITH SINK` has no user-visible properties, the corresponding clause is omitted.
4. Properties with the `__system` or `__audit` prefix and system-injected authentication context are omitted. User-configured authentication properties required to recreate connection semantics are retained.
5. Only the static task definition is returned; runtime state, historical errors, remaining event count, and transmission progress are not included.

**Example:**

View the creation information for the existing task `table1_pipe_realtime`:

```SQL
SHOW CREATE PIPE table1_pipe_realtime;
```

Result:

```text
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Pipe| Create Pipe|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|table1_pipe_realtime|CREATE PIPE "table1_pipe_realtime" WITH SOURCE ('database-name'='database1','end-time'='2024-11-28T11:00:00+08:00','history.enable'='false','mode.strict'='true','realtime.enable'='true','start-time'='2024-11-28T08:00:00+08:00','table-name'='table1') WITH SINK ('sink'='do-nothing-sink')|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```

### 2.7 Modify a Task

The `ALTER PIPE` statement dynamically updates an existing PIPE and supports modifying or replacing the configuration of source, processor, and sink.

Expand All @@ -257,7 +300,7 @@ Example:
ALTER PIPE A2B REPLACE SINK ('sink'='iotdb-thrift-sink', 'node-urls' = '127.0.0.1:6668');
```

### 2.7 Synchronization Plugins
### 2.8 Synchronization Plugins

To make the architecture more flexible and adaptable to different synchronization scenarios, IoTDB supports plugin assembly in the synchronization task framework. The system provides some common pre-installed plugins, and you can also customize `processor` and `sink` plugins and load them into the IoTDB system.

Expand Down
2 changes: 2 additions & 0 deletions src/UserGuide/latest/User-Manual/Data-Sync_apache.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ By declaratively configuring the specific content of the three parts through SQL

1. The schema and auth synchronization functions have the following limitations:

- Since V2.0.12, the time series name at the sender can be modified after synchronization is established, and the synchronization link continues to run normally after the modification.

- When using schema synchronization, it is required that the consensus protocol for `Schema region` and `ConfigNode` must be the default ratis protocol. This means that the `iotdb-system.properties` configuration file should contain the settings `config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus` and `schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus`. If these are not specified, the default ratis protocol is used.

- To prevent potential conflicts, please disable the automatic creation of schema on the receiving end when enabling schema synchronization. This can be done by setting the `enable_auto_create_schema` configuration in the `iotdb-system.properties` file to false.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,49 @@ SHOW DATABASES DETAILS;
+------------------+-------+-----------------------+---------------------+---------------------+--------------------+-----------------------+------------------+---------------------+
```

### 2.5 统计数据库数量
### 2.5 查看数据库的创建信息

用于获取指定表模型数据库的创建语句,自 V2.0.12 版本起支持该功能。

**语法:**

```SQL
SHOW CREATE DATABASE <DATABASE_NAME>;
```

**返回结果:**

| **列名** | **类型** | **含义** |
| :---------------- | :------- | :-------------------------------- |
| Database | TEXT | 数据库名称。 |
| Create Database | TEXT | 可用于重建数据库定义的 `CREATE DATABASE` 语句。 |

**说明:**

1. 不支持系统数据库 `information_schema`。权限检查与查看或使用数据库一致。
2. 返回语句中的数据库名称统一使用双引号。
3. TTL 为无限 TTL 时输出 `INF`,有限 TTL 输出数值;`time_partition_interval`、`max_schema_region_group_num` 和 `max_data_region_group_num` 输出实际生效值。
4. 数据库不存在时,返回 `Unknown database <database>` 错误。

**示例:**

查看已存在数据库 `database1` 的创建信息:

```SQL
SHOW CREATE DATABASE database1;
```

结果:

```SQL
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Database| Create Database|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
|database1|CREATE DATABASE "database1" WITH (ttl=31536000000,time_partition_interval=604800000,max_schema_region_group_num=1,max_data_region_group_num=7)|
+---------+----------------------------------------------------------------------------------------------------------------------------------------------+
```

### 2.6 统计数据库数量

用于统计数据库的总数。该语法自 V2.0.11 版本起支持。

Expand All @@ -188,7 +230,7 @@ TimechoDB> COUNT DATABASES
+-----+
```

### 2.6 修改数据库
### 2.7 修改数据库

用于修改数据库中的部分属性。

Expand All @@ -209,7 +251,7 @@ ALTER DATABASE database1 SET PROPERTIES TTL=31536000000;
ALTER DATABASE database1 SET PROPERTIES MAX_SCHEMA_REGION_GROUP_NUM=2, MAX_DATA_REGION_GROUP_NUM=4;
```

### 2.7 删除数据库
### 2.8 删除数据库

用于删除数据库。

Expand Down
Loading