Metadata Export

1. Overview

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.

Supported since version 1.3.3

2. Detailed Functionality

2.1 Parameter Description

Short ParameterFull ParameterDescriptionRequiredDefault Value
-h--hostHostnameNo127.0.0.1
-p--portPort numberNo6667
-u--usernameUsernameNoroot
-pw--passwordPasswordNoroot
-t--targetSpecifies the target directory for output files. The directory will be created if it does not existYes-
-path--path_patternSpecifies the path pattern for metadata exportYes-
-pf--path_pattern_fileSpecifies the name of the export fileNo-
-lpf--lines_per_fileSpecifies the maximum number of lines per exported dump fileNo10000
-timeout--queryTimeoutQuery timeout for the session (ms)No-1. Range: -1 ~ Long.MAX_VALUE = 9223372036854775807
-help--helpDisplays help informationNo-

2.2 Execution Commands

# Unix/OS X
> tools/export-schema.sh [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
       [-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
       [-timeout <timeout>] [-help]

# Windows
> tools\export-schema.bat [-h <host>] [-p <port>] [-u <username>] [-pw <password>] -t <targetDir>
       [-path <exportPathPattern>] [-pf <exportPathPatternFile>] [-lpf <linesPerFile>]
       [-timeout <timeout>] [-help]

2.3 Usage Example

# Export metadata under the root.ln path
./export-schema.sh -t /home/ -path "root.ln.**"
# Export result format
Timeseries,Alias,DataType,Encoding,Compression
root.ln.wf02.wt02.status,,BOOLEAN,RLE,LZ4
root.ln.wf02.wt02.hardware,,TEXT,PLAIN,LZ4