You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Data subscription and synchronization support create if not exists an… (#420)
* Data subscription and synchronization support create if not exists and drop if exists interfaces
* The pipe plugin supports the create if not exists and drop if exists interfaces
Copy file name to clipboardExpand all lines: src/UserGuide/Master/User-Manual/Data-Sync_apache.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ Use the `CREATE PIPE` statement to create a data synchronization task. The `Pipe
103
103
The SQL example is as follows:
104
104
105
105
```SQL
106
-
CREATE PIPE <PipeId>-- PipeId is the name that uniquely identifies the task.
106
+
CREATE PIPE [IF NOT EXISTS] <PipeId>-- PipeId is the name that uniquely identifies the task.
107
107
-- Data extraction plugin, optional plugin
108
108
WITH SOURCE (
109
109
[<parameter>=<value>,],
@@ -118,6 +118,8 @@ WITH SINK (
118
118
)
119
119
```
120
120
121
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe does not exist, preventing errors caused by attempting to create an existing Pipe.
122
+
121
123
### Start Task
122
124
123
125
After creation, the task will not be processed immediately and needs to be started. Use the `START PIPE` statement to start the task and begin processing data:
@@ -139,8 +141,9 @@ STOP PIPE <PipeId>
139
141
Deletes the specified task:
140
142
141
143
```SQL
142
-
DROP PIPE <PipeId>
144
+
DROP PIPE [IF EXISTS] <PipeId>
143
145
```
146
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe exists, the delete command is executed to prevent errors caused by attempting to delete non-existent Pipes.
144
147
145
148
Deleting a task does not require stopping the synchronization task first.
Copy file name to clipboardExpand all lines: src/UserGuide/Master/User-Manual/Data-Sync_timecho.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ Use the `CREATE PIPE` statement to create a data synchronization task. The `Pipe
105
105
The SQL example is as follows:
106
106
107
107
```SQL
108
-
CREATE PIPE <PipeId>-- PipeId is the name that uniquely identifies the task.
108
+
CREATE PIPE [IF NOT EXISTS] <PipeId>-- PipeId is the name that uniquely identifies the task.
109
109
-- Data extraction plugin, optional plugin
110
110
WITH SOURCE (
111
111
[<parameter>=<value>,],
@@ -120,6 +120,8 @@ WITH SINK (
120
120
)
121
121
```
122
122
123
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe does not exist, preventing errors caused by attempting to create an existing Pipe.
124
+
123
125
### Start Task
124
126
125
127
After creation, the task will not be processed immediately and needs to be started. Use the `START PIPE` statement to start the task and begin processing data:
@@ -141,8 +143,9 @@ STOP PIPE <PipeId>
141
143
Deletes the specified task:
142
144
143
145
```SQL
144
-
DROP PIPE <PipeId>
146
+
DROP PIPE [IF EXISTS] <PipeId>
145
147
```
148
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe exists, the delete command is executed to prevent errors caused by attempting to delete non-existent Pipes.
146
149
147
150
Deleting a task does not require stopping the synchronization task first.
Copy file name to clipboardExpand all lines: src/UserGuide/Master/User-Manual/Data-subscription.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,14 @@ IoTDB supports the creation, deletion, and viewing of Topics through SQL stateme
46
46
The SQL statement is as follows:
47
47
48
48
```SQL
49
-
CREATE TOPIC <topicName>
49
+
CREATE TOPIC [IF NOT EXISTS] <topicName>
50
50
WITH (
51
51
[<parameter>=<value>,],
52
52
);
53
53
```
54
54
55
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified topic does not exist, preventing errors caused by attempting to create an existing topic.
56
+
55
57
Detailed explanation of each parameter is as follows:
56
58
57
59
| Key | Required or Optional with Default | Description |
@@ -74,7 +76,7 @@ Examples are as follows:
74
76
CREATE TOPIC root_all;
75
77
76
78
-- Custom subscription
77
-
CREATE TOPIC db_timerange
79
+
CREATE TOPIC IF NOT EXISTS db_timerange
78
80
WITH (
79
81
'path'='root.db.**',
80
82
'start-time'='2023-01-01',
@@ -87,8 +89,9 @@ WITH (
87
89
A Topic can only be deleted if it is not subscribed to. When a Topic is deleted, its related consumption progress will be cleared.
88
90
89
91
```SQL
90
-
DROP TOPIC <topicName>;
92
+
DROP TOPIC [IF EXISTS] <topicName>;
91
93
```
94
+
**IF EXISTS semantics**: Used in deletion operations to ensure that the delete command is executed when a specified topic exists, preventing errors caused by attempting to delete non-existent topics.
92
95
93
96
#### 3.1.3 View Topic
94
97
@@ -142,7 +145,7 @@ The `SubscriptionSession` class in the IoTDB subscription client provides interf
Copy file name to clipboardExpand all lines: src/UserGuide/Master/User-Manual/Streaming_apache.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -445,15 +445,17 @@ In IoTDB, to dynamically load a user-defined plugin into the system, you first n
445
445
The syntax of the loading plugin management statement is as follows:
446
446
447
447
```sql
448
-
CREATE PIPEPLUGIN <alias>
448
+
CREATE PIPEPLUGIN [IF NOT EXISTS] <alias>
449
449
AS<Full class name>
450
450
USING <URL of jar file>
451
451
```
452
452
453
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe Plugin does not exist, preventing errors caused by attempting to create an existing Pipe Plugin.
454
+
453
455
For example, if a user implements a data processing plugin with the fully qualified class name "edu.tsinghua.iotdb.pipe.ExampleProcessor" and packages it into a jar file, which is stored at "https://example.com:8080/iotdb/pipe-plugin.jar", and the user wants to use this plugin in the stream processing engine, marking the plugin as "example". The creation statement for this data processing plugin is as follows:
454
456
455
457
```sql
456
-
CREATE PIPEPLUGIN example
458
+
CREATE PIPEPLUGIN IF NOT EXISTS example
457
459
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
458
460
USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
459
461
```
@@ -462,9 +464,11 @@ USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
462
464
463
465
When user no longer wants to use a plugin and needs to uninstall the plugin from the system, you can use the Remove plugin statement as shown below.
464
466
```sql
465
-
DROP PIPEPLUGIN <alias>
467
+
DROP PIPEPLUGIN [IF EXISTS] <alias>
466
468
```
467
469
470
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe Plugin exists, the delete command is executed to prevent errors caused by attempting to delete a non-existent Pipe Plugin.
471
+
468
472
### Show Plugin Statement
469
473
470
474
User can also view the plugin in the system on need. The statement to view plugin is as follows.
Copy file name to clipboardExpand all lines: src/UserGuide/Master/User-Manual/Streaming_timecho.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -451,10 +451,11 @@ Then the plugin class needs to be compiled and packaged into a jar executable fi
451
451
The syntax of the management statement for loading the plugin is shown in the figure.
452
452
453
453
```sql
454
-
CREATE PIPEPLUGIN <alias>
454
+
CREATE PIPEPLUGIN [IF NOT EXISTS] <alias>
455
455
AS<full class name>
456
456
USING <URI of JAR package>
457
457
```
458
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe Plugin does not exist, preventing errors caused by attempting to create an existing Pipe Plugin.
458
459
459
460
Example: If you implement a data processing plugin named edu.tsinghua.iotdb.pipe.ExampleProcessor, and the packaged jar package is pipe-plugin.jar, you want to use this plugin in the stream processing engine, and mark the plugin as example. There are two ways to use the plugin package, one is to upload to the URI server, and the other is to upload to the local directory of the cluster.
460
461
@@ -465,7 +466,7 @@ Preparation: To register in this way, you need to upload the JAR package to the
465
466
SQL:
466
467
467
468
```sql
468
-
CREATE PIPEPLUGIN example
469
+
CREATE PIPEPLUGIN IF NOT EXISTS example
469
470
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
470
471
USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
471
472
```
@@ -477,7 +478,7 @@ Preparation: To register in this way, you need to place the JAR package in any p
477
478
SQL:
478
479
479
480
```sql
480
-
CREATE PIPEPLUGIN example
481
+
CREATE PIPEPLUGIN IF NOT EXISTS example
481
482
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
482
483
USING URI '<file:/IoTDB installation path/iotdb-1.x.x-bin/ext/pipe/pipe-plugin.jar>'
483
484
```
@@ -487,9 +488,11 @@ USING URI '<file:/IoTDB installation path/iotdb-1.x.x-bin/ext/pipe/pipe-plugin.j
487
488
When the user no longer wants to use a plugin and needs to uninstall the plugin from the system, he can use the delete plugin statement as shown in the figure.
488
489
489
490
```sql
490
-
DROP PIPEPLUGIN <alias>
491
+
DROP PIPEPLUGIN [IF EXISTS] <alias>
491
492
```
492
493
494
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe Plugin exists, the delete command is executed to prevent errors caused by attempting to delete a non-existent Pipe Plugin.
495
+
493
496
### View plugin statements
494
497
495
498
Users can also view plugins in the system on demand. View the statement of the plugin as shown in the figure.
Copy file name to clipboardExpand all lines: src/UserGuide/latest/User-Manual/Data-Sync_apache.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ Use the `CREATE PIPE` statement to create a data synchronization task. The `Pipe
103
103
The SQL example is as follows:
104
104
105
105
```SQL
106
-
CREATE PIPE <PipeId>-- PipeId is the name that uniquely identifies the task.
106
+
CREATE PIPE [IF NOT EXISTS] <PipeId>-- PipeId is the name that uniquely identifies the task.
107
107
-- Data extraction plugin, optional plugin
108
108
WITH SOURCE (
109
109
[<parameter>=<value>,],
@@ -118,6 +118,8 @@ WITH SINK (
118
118
)
119
119
```
120
120
121
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe does not exist, preventing errors caused by attempting to create an existing Pipe.
122
+
121
123
### Start Task
122
124
123
125
After creation, the task will not be processed immediately and needs to be started. Use the `START PIPE` statement to start the task and begin processing data:
@@ -139,8 +141,9 @@ STOP PIPE <PipeId>
139
141
Deletes the specified task:
140
142
141
143
```SQL
142
-
DROP PIPE <PipeId>
144
+
DROP PIPE [IF EXISTS] <PipeId>
143
145
```
146
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe exists, the delete command is executed to prevent errors caused by attempting to delete non-existent Pipes.
144
147
145
148
Deleting a task does not require stopping the synchronization task first.
Copy file name to clipboardExpand all lines: src/UserGuide/latest/User-Manual/Data-Sync_timecho.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@ Use the `CREATE PIPE` statement to create a data synchronization task. The `Pipe
105
105
The SQL example is as follows:
106
106
107
107
```SQL
108
-
CREATE PIPE <PipeId>-- PipeId is the name that uniquely identifies the task.
108
+
CREATE PIPE [IF NOT EXISTS] <PipeId>-- PipeId is the name that uniquely identifies the task.
109
109
-- Data extraction plugin, optional plugin
110
110
WITH SOURCE (
111
111
[<parameter>=<value>,],
@@ -120,6 +120,8 @@ WITH SINK (
120
120
)
121
121
```
122
122
123
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe does not exist, preventing errors caused by attempting to create an existing Pipe.
124
+
123
125
### Start Task
124
126
125
127
After creation, the task will not be processed immediately and needs to be started. Use the `START PIPE` statement to start the task and begin processing data:
@@ -141,8 +143,9 @@ STOP PIPE <PipeId>
141
143
Deletes the specified task:
142
144
143
145
```SQL
144
-
DROP PIPE <PipeId>
146
+
DROP PIPE [IF EXISTS] <PipeId>
145
147
```
148
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe exists, the delete command is executed to prevent errors caused by attempting to delete non-existent Pipes.
146
149
147
150
Deleting a task does not require stopping the synchronization task first.
Copy file name to clipboardExpand all lines: src/UserGuide/latest/User-Manual/Data-subscription.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,14 @@ IoTDB supports the creation, deletion, and viewing of Topics through SQL stateme
46
46
The SQL statement is as follows:
47
47
48
48
```SQL
49
-
CREATE TOPIC <topicName>
49
+
CREATE TOPIC [IF NOT EXISTS] <topicName>
50
50
WITH (
51
51
[<parameter>=<value>,],
52
52
);
53
53
```
54
54
55
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified topic does not exist, preventing errors caused by attempting to create an existing topic.
56
+
55
57
Detailed explanation of each parameter is as follows:
56
58
57
59
| Key | Required or Optional with Default | Description |
@@ -74,7 +76,7 @@ Examples are as follows:
74
76
CREATE TOPIC root_all;
75
77
76
78
-- Custom subscription
77
-
CREATE TOPIC db_timerange
79
+
CREATE TOPIC IF NOT EXISTS db_timerange
78
80
WITH (
79
81
'path'='root.db.**',
80
82
'start-time'='2023-01-01',
@@ -87,8 +89,9 @@ WITH (
87
89
A Topic can only be deleted if it is not subscribed to. When a Topic is deleted, its related consumption progress will be cleared.
88
90
89
91
```SQL
90
-
DROP TOPIC <topicName>;
92
+
DROP TOPIC [IF EXISTS] <topicName>;
91
93
```
94
+
**IF EXISTS semantics**: Used in deletion operations to ensure that the delete command is executed when a specified topic exists, preventing errors caused by attempting to delete non-existent topics.
92
95
93
96
#### 3.1.3 View Topic
94
97
@@ -142,7 +145,7 @@ The `SubscriptionSession` class in the IoTDB subscription client provides interf
Copy file name to clipboardExpand all lines: src/UserGuide/latest/User-Manual/Streaming_apache.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -445,15 +445,17 @@ In IoTDB, to dynamically load a user-defined plugin into the system, you first n
445
445
The syntax of the loading plugin management statement is as follows:
446
446
447
447
```sql
448
-
CREATE PIPEPLUGIN <alias>
448
+
CREATE PIPEPLUGIN [IF NOT EXISTS] <alias>
449
449
AS<Full class name>
450
450
USING <URL of jar file>
451
451
```
452
452
453
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe Plugin does not exist, preventing errors caused by attempting to create an existing Pipe Plugin.
454
+
453
455
For example, if a user implements a data processing plugin with the fully qualified class name "edu.tsinghua.iotdb.pipe.ExampleProcessor" and packages it into a jar file, which is stored at "https://example.com:8080/iotdb/pipe-plugin.jar", and the user wants to use this plugin in the stream processing engine, marking the plugin as "example". The creation statement for this data processing plugin is as follows:
454
456
455
457
```sql
456
-
CREATE PIPEPLUGIN example
458
+
CREATE PIPEPLUGIN IF NOT EXISTS example
457
459
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
458
460
USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
459
461
```
@@ -462,9 +464,11 @@ USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
462
464
463
465
When user no longer wants to use a plugin and needs to uninstall the plugin from the system, you can use the Remove plugin statement as shown below.
464
466
```sql
465
-
DROP PIPEPLUGIN <alias>
467
+
DROP PIPEPLUGIN [IF EXISTS] <alias>
466
468
```
467
469
470
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe Plugin exists, the delete command is executed to prevent errors caused by attempting to delete a non-existent Pipe Plugin.
471
+
468
472
### Show Plugin Statement
469
473
470
474
User can also view the plugin in the system on need. The statement to view plugin is as follows.
Copy file name to clipboardExpand all lines: src/UserGuide/latest/User-Manual/Streaming_timecho.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -451,10 +451,11 @@ Then the plugin class needs to be compiled and packaged into a jar executable fi
451
451
The syntax of the management statement for loading the plugin is shown in the figure.
452
452
453
453
```sql
454
-
CREATE PIPEPLUGIN <alias>
454
+
CREATE PIPEPLUGIN [IF NOT EXISTS] <alias>
455
455
AS<full class name>
456
456
USING <URI of JAR package>
457
457
```
458
+
**IF NOT EXISTS semantics**: Used in creation operations to ensure that the create command is executed when the specified Pipe Plugin does not exist, preventing errors caused by attempting to create an existing Pipe Plugin.
458
459
459
460
Example: If you implement a data processing plugin named edu.tsinghua.iotdb.pipe.ExampleProcessor, and the packaged jar package is pipe-plugin.jar, you want to use this plugin in the stream processing engine, and mark the plugin as example. There are two ways to use the plugin package, one is to upload to the URI server, and the other is to upload to the local directory of the cluster.
460
461
@@ -465,7 +466,7 @@ Preparation: To register in this way, you need to upload the JAR package to the
465
466
SQL:
466
467
467
468
```sql
468
-
CREATE PIPEPLUGIN example
469
+
CREATE PIPEPLUGIN IF NOT EXISTS example
469
470
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
470
471
USING URI '<https://example.com:8080/iotdb/pipe-plugin.jar>'
471
472
```
@@ -477,7 +478,7 @@ Preparation: To register in this way, you need to place the JAR package in any p
477
478
SQL:
478
479
479
480
```sql
480
-
CREATE PIPEPLUGIN example
481
+
CREATE PIPEPLUGIN IF NOT EXISTS example
481
482
AS'edu.tsinghua.iotdb.pipe.ExampleProcessor'
482
483
USING URI '<file:/IoTDB installation path/iotdb-1.x.x-bin/ext/pipe/pipe-plugin.jar>'
483
484
```
@@ -487,9 +488,11 @@ USING URI '<file:/IoTDB installation path/iotdb-1.x.x-bin/ext/pipe/pipe-plugin.j
487
488
When the user no longer wants to use a plugin and needs to uninstall the plugin from the system, he can use the delete plugin statement as shown in the figure.
488
489
489
490
```sql
490
-
DROP PIPEPLUGIN <alias>
491
+
DROP PIPEPLUGIN [IF EXISTS] <alias>
491
492
```
492
493
494
+
**IF EXISTS semantics**: Used in deletion operations to ensure that when a specified Pipe Plugin exists, the delete command is executed to prevent errors caused by attempting to delete a non-existent Pipe Plugin.
495
+
493
496
### View plugin statements
494
497
495
498
Users can also view plugins in the system on demand. View the statement of the plugin as shown in the figure.
0 commit comments