Skip to content

Commit 7b83d03

Browse files
authored
add schema export and import from 1.3.3 (#1142)
1 parent effc8f3 commit 7b83d03

12 files changed

Lines changed: 672 additions & 24 deletions

File tree

src/.vuepress/sidebar/V1.3.x/en.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,22 @@ export const enSidebar = {
168168
{ text: 'Monitor Tool', link: 'Monitor-Tool_apache' },
169169
{ text: 'Benchmark Tool', link: 'Benchmark' },
170170
{ text: 'Cluster Management Tool', link: 'Maintenance-Tool_apache' },
171-
{ text: 'Data Import Export(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
172-
{ text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
173-
{ text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' },
174-
{ text: 'Data Import(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
175-
{ text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' },
176-
{ text: 'Data Export(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
171+
{ text: 'Data Import & Export', collapsible: true,
172+
children: [
173+
{ text: 'Data Import Export(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
174+
{ text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
175+
{ text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' },
176+
{ text: 'Data Import(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
177+
{ text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' },
178+
{ text: 'Data Export(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
179+
],
180+
},
181+
{ text: 'Schema Import & Export', collapsible: true,
182+
children: [
183+
{ text: 'Schema Import', link: 'Schema-Import-Tool' },
184+
{ text: 'Schema Export', link: 'Schema-Export-Tool' },
185+
],
186+
},
177187
{ text: 'Full Backup Tool(V1.3.2)', link: 'Backup-Tool' },
178188
{ text: 'Health Check Tool(V1.3.2)', link: 'Health-Check-Tool' },
179189
],

src/.vuepress/sidebar/V1.3.x/zh.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,22 @@ export const zhSidebar = {
159159
{ text: '监控工具', link: 'Monitor-Tool_apache' },
160160
{ text: '测试工具', link: 'Benchmark' },
161161
{ text: '集群管理工具', link: 'Maintenance-Tool_apache' },
162-
{ text: '数据导入导出(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
163-
{ text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
164-
{ text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' },
165-
{ text: '数据导入(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
166-
{ text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' },
167-
{ text: '数据导出(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
162+
{ text: '数据导入导出', collapsible: true,
163+
children: [
164+
{ text: '数据导入导出(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
165+
{ text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
166+
{ text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' },
167+
{ text: '数据导入(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
168+
{ text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' },
169+
{ text: '数据导出(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
170+
],
171+
},
172+
{ text: '元数据导入导出', collapsible: true,
173+
children: [
174+
{ text: '元数据导入', link: 'Schema-Import-Tool' },
175+
{ text: '元数据导出', link: 'Schema-Export-Tool' },
176+
],
177+
},
168178
{ text: '全量备份工具(V1.3.2)', link: 'Backup-Tool' },
169179
{ text: '健康检查工具(V1.3.2)', link: 'Health-Check-Tool' },
170180
],

src/.vuepress/sidebar_timecho/V1.3.x/en.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,22 @@ export const enSidebar = {
194194
{ text: 'Monitor Tool', link: 'Monitor-Tool_timecho' },
195195
{ text: 'Benchmark Tool', link: 'Benchmark' },
196196
{ text: 'Cluster Management Tool', link: 'Maintenance-Tool_timecho' },
197-
{ text: 'Data Import Export(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
198-
{ text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
199-
{ text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' },
200-
{ text: 'Data Import(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
201-
{ text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' },
202-
{ text: 'Data Export(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
197+
{ text: 'Data Import & Export', collapsible: true,
198+
children: [
199+
{ text: 'Data Import Export(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
200+
{ text: 'TsFile Import Export(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
201+
{ text: 'Data Import(V1.3.3)', link: 'Data-Import-Tool' },
202+
{ text: 'Data Import(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
203+
{ text: 'Data Export(V1.3.3)', link: 'Data-Export-Tool' },
204+
{ text: 'Data Export(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
205+
],
206+
},
207+
{ text: 'Schema Import & Export', collapsible: true,
208+
children: [
209+
{ text: 'Schema Import', link: 'Schema-Import-Tool' },
210+
{ text: 'Schema Export', link: 'Schema-Export-Tool' },
211+
],
212+
},
203213
{ text: 'Full Backup Tool(V1.3.2)', link: 'Backup-Tool' },
204214
{ text: 'Health Check Tool(V1.3.2)', link: 'Health-Check-Tool' },
205215
],

src/.vuepress/sidebar_timecho/V1.3.x/zh.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,22 @@ export const zhSidebar = {
176176
{ text: '监控工具', link: 'Monitor-Tool_timecho' },
177177
{ text: '测试工具', link: 'Benchmark' },
178178
{ text: '集群管理工具', link: 'Maintenance-Tool_timecho' },
179-
{ text: '数据导入导出(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
180-
{ text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
181-
{ text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' },
182-
{ text: '数据导入(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
183-
{ text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' },
184-
{ text: '数据导出(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
179+
{ text: '数据导入导出', collapsible: true,
180+
children: [
181+
{ text: '数据导入导出(V1.3.0/1/2)', link: 'Data-Import-Export-Tool' },
182+
{ text: 'TsFile导入导出(V1.3.0/1/2)', link: 'TsFile-Import-Export-Tool' },
183+
{ text: '数据导入(V1.3.3)', link: 'Data-Import-Tool' },
184+
{ text: '数据导入(V1.3.4)', link: 'Data-Import-Tool-1-3-4' },
185+
{ text: '数据导出(V1.3.3)', link: 'Data-Export-Tool' },
186+
{ text: '数据导出(V1.3.4)', link: 'Data-Export-Tool-1-3-4' },
187+
],
188+
},
189+
{ text: '元数据导入导出', collapsible: true,
190+
children: [
191+
{ text: '元数据导入', link: 'Schema-Import-Tool' },
192+
{ text: '元数据导出', link: 'Schema-Export-Tool' },
193+
],
194+
},
185195
{ text: '全量备份工具(V1.3.2)', link: 'Backup-Tool' },
186196
{ text: '健康检查工具(V1.3.2)', link: 'Health-Check-Tool' },
187197
],
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
# Metadata Export
22+
23+
## 1. Overview
24+
25+
The metadata export tool `export-schema.sh/bat` is located in the `tools` directory. It can export metadata from a specified database in IoTDB into CSV files.
26+
27+
> Supported since version 1.3.3
28+
29+
## 2. Detailed Functionality
30+
31+
### 2.1 Parameter Description
32+
33+
| Short Parameter | Full Parameter | Description | Required | Default Value |
34+
|-----------------|----------------|-------------|----------|---------------|
35+
| `-h` | `--host` | Hostname | No | 127.0.0.1 |
36+
| `-p` | `--port` | Port number | No | 6667 |
37+
| `-u` | `--username` | Username | No | root |
38+
| `-pw` | `--password` | Password. Hidden input is supported since V2.0.9-beta | No | root |
39+
| `-t` | `--target` | Specifies the target directory for output files. The directory will be created if it does not exist | Yes | - |
40+
| `-path` | `--path_pattern` | Specifies the path pattern for metadata export | Yes | - |
41+
| `-pf` | `--path_pattern_file` | Specifies the name of the export file | No | - |
42+
| `-lpf` | `--lines_per_file` | Specifies the maximum number of lines per exported dump file | No | `10000` |
43+
| `-timeout` | `--queryTimeout` | Query timeout for the session (ms) | No | -1. Range: -1 ~ Long.MAX_VALUE = 9223372036854775807 |
44+
| `-help` | `--help` | Displays help information | No | - |
45+
46+
### 2.2 Execution Commands
47+
48+
```Bash
49+
# Unix/OS X
50+
> tools/export-schema.sh [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
51+
[-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
52+
[-timeout <timeout>] [-help]
53+
54+
# Windows
55+
> tools\export-schema.bat [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
56+
[-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
57+
[-timeout <timeout>] [-help]
58+
```
59+
60+
### 2.3 Usage Example
61+
62+
```Bash
63+
# Export metadata under the root.ln path
64+
./export-schema.sh -t /home/ -path "root.ln.**"
65+
```
66+
67+
```CSV
68+
# Export result format
69+
Timeseries,Alias,DataType,Encoding,Compression
70+
root.ln.wf02.wt02.status,,BOOLEAN,RLE,LZ4
71+
root.ln.wf02.wt02.hardware,,TEXT,PLAIN,LZ4
72+
```
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
# Metadata Import
23+
24+
## 1. Overview
25+
26+
The metadata import tool `import-schema.sh/bat` is located in the `tools` directory. It can import CSV files containing metadata creation statements from a specified path into IoTDB.
27+
28+
> Supported since version 1.3.3
29+
30+
## 2. Detailed Functionality
31+
32+
### 2.1 Parameter Description
33+
34+
| Short Parameter | Full Parameter | Description | Required | Default Value |
35+
|-----------------|----------------|-------------|----------|---------------|
36+
| `-h` | `--host` | Hostname | No | 127.0.0.1 |
37+
| `-p` | `--port` | Port number | No | 6667 |
38+
| `-u` | `--username` | Username | No | root |
39+
| `-pw` | `--password` | Password | No | root |
40+
| `-s` | `--source` | Local path of the script file or directory to be loaded | Yes | - |
41+
| `-fd` | `--fail_dir` | Specifies the directory to save failed files | No | - |
42+
| `-lpf` | `--lines_per_failed_file` | Specifies the maximum number of lines per failed file | No | 100000. Range: 0 ~ Integer.MAX_VALUE = 2147483647 |
43+
| `-help` | `--help` | Displays help information | No | - |
44+
45+
### 2.2 Execution Commands
46+
47+
```Bash
48+
# Unix/OS X
49+
tools/import-schema.sh [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -s
50+
<sourceDir/sourceFile> [-fd <failDir>] [-batch <batchSize>] [-lpf <linesPerFile>] [-help]
51+
52+
# Windows
53+
tools\import-schema.bat [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -s
54+
<sourceDir/sourceFile> [-fd <failDir>] [-batch <batchSize>] [-lpf <linesPerFile>] [-help]
55+
```
56+
57+
### 2.3 Usage Example
58+
59+
```SQL
60+
-- Before import
61+
IoTDB> show timeseries root.ln.**
62+
+----------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
63+
|Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
64+
+----------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
65+
+----------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
66+
```
67+
68+
```Bash
69+
# Execute the import command
70+
./import-schema.sh -s /home/dump0_0.csv
71+
```
72+
73+
```SQL
74+
-- Verify after successful import
75+
IoTDB> show timeseries root.ln.**
76+
+--------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
77+
| Timeseries|Alias|Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
78+
+--------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
79+
| root.ln.wf02.wt02.status| null| root.ln| BOOLEAN| RLE| LZ4|null| null| null| null| BASE|
80+
|root.ln.wf02.wt02.hardware| null| root.ln| TEXT| PLAIN| LZ4|null| null| null| null| BASE|
81+
+--------------------------+-----+--------+--------+--------+-----------+----+----------+--------+------------------+--------+
82+
```
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
# Metadata Export
22+
23+
## 1. Overview
24+
25+
The metadata export tool `export-schema.sh/bat` is located in the `tools` directory. It can export metadata from a specified database in IoTDB into CSV files.
26+
27+
> Supported since version 1.3.3
28+
29+
## 2. Detailed Functionality
30+
31+
### 2.1 Parameter Description
32+
33+
| Short Parameter | Full Parameter | Description | Required | Default Value |
34+
|-----------------|----------------|-------------|----------|---------------|
35+
| `-h` | `--host` | Hostname | No | 127.0.0.1 |
36+
| `-p` | `--port` | Port number | No | 6667 |
37+
| `-u` | `--username` | Username | No | root |
38+
| `-pw` | `--password` | Password. Hidden input is supported since V2.0.9-beta | No | root |
39+
| `-t` | `--target` | Specifies the target directory for output files. The directory will be created if it does not exist | Yes | - |
40+
| `-path` | `--path_pattern` | Specifies the path pattern for metadata export | Yes | - |
41+
| `-pf` | `--path_pattern_file` | Specifies the name of the export file | No | - |
42+
| `-lpf` | `--lines_per_file` | Specifies the maximum number of lines per exported dump file | No | `10000` |
43+
| `-timeout` | `--queryTimeout` | Query timeout for the session (ms) | No | -1. Range: -1 ~ Long.MAX_VALUE = 9223372036854775807 |
44+
| `-help` | `--help` | Displays help information | No | - |
45+
46+
### 2.2 Execution Commands
47+
48+
```Bash
49+
# Unix/OS X
50+
> tools/export-schema.sh [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
51+
[-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
52+
[-timeout <timeout>] [-help]
53+
54+
# Windows
55+
> tools\export-schema.bat [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
56+
[-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
57+
[-timeout <timeout>] [-help]
58+
```
59+
60+
### 2.3 Usage Example
61+
62+
```Bash
63+
# Export metadata under the root.ln path
64+
./export-schema.sh -t /home/ -path "root.ln.**"
65+
```
66+
67+
```CSV
68+
# Export result format
69+
Timeseries,Alias,DataType,Encoding,Compression
70+
root.ln.wf02.wt02.status,,BOOLEAN,RLE,LZ4
71+
root.ln.wf02.wt02.hardware,,TEXT,PLAIN,LZ4
72+
```

0 commit comments

Comments
 (0)