This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git
The following commit(s) were added to refs/heads/main by this push:
new 206642e update every level and link Name (#297)
206642e is described below
commit 206642e2d889290b365818f8a171cf30c664203f
Author: Summer <[email protected]>
AuthorDate: Fri Aug 2 18:34:01 2024 +0800
update every level and link Name (#297)
Co-authored-by: 2b3c511 <[email protected]>
---
.../Master/Tools-System/Data-Import-Export-Tool.md | 86 ++++++++++-----------
.../latest/Tools-System/Data-Import-Export-Tool.md | 20 ++---
.../Master/Tools-System/Data-Import-Export-Tool.md | 20 ++---
.../latest/Tools-System/Data-Import-Export-Tool.md | 90 +++++++++++-----------
4 files changed, 108 insertions(+), 108 deletions(-)
diff --git a/src/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
b/src/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
index c84fb06..6588513 100644
--- a/src/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
+++ b/src/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
@@ -21,7 +21,7 @@
# Data Import Export Script
-IoTDB provides data import and export scripts (tools/export-data,
tools/import-data, supported in versions 1.3.2 and above; for historical
versions, tools/export-csv, tools/import-csv scripts can be used, see the
reference link for usage [Import Export Tool](./TsFile-Import-Export-Tool.md)
), which are used to facilitate the interaction between IoTDB internal data and
external files, suitable for batch operations of single files or directories.
+IoTDB provides data import and export scripts (tools/export-data,
tools/import-data, supported in versions 1.3.2 and above; for historical
versions, tools/export-csv, tools/import-csv scripts can be used, see the
reference link for usage [Document](./TsFile-Import-Export-Tool.md) ), which
are used to facilitate the interaction between IoTDB internal data and external
files, suitable for batch operations of single files or directories.
## Supported Data Formats
@@ -29,9 +29,9 @@ IoTDB provides data import and export scripts
(tools/export-data, tools/import-d
- **CSV** : Plain text format for storing formatted data, which must be
constructed according to the specified CSV format below.
- **SQL** : Files containing custom SQL statements.
-# export-data Script (Data Export)
+## export-data Script (Data Export)
-## Command
+### Command
```Bash
# Unix/OS X
@@ -69,10 +69,10 @@ SQL Statement Support Rules:
| Raw data multi-device query (align by device) | Supported
| select * from root.** align by device |
| Raw data multi-device query (without align by device) | Unsupported
| select * from root.**<br/>select * from root.s_0.* |
-## Running Examples
+### Running Examples
- Export all data within a certain SQL execution range to a CSV file.
- ```Bash
+```Bash
# Unix/OS X
>tools/export-data.sh -t ./data/ -q 'select * from root.stock.**'
# Windows
@@ -86,12 +86,12 @@ SQL Statement Support Rules:
2024-07-29T18:37:19.701+08:00,0.3057328,3.0,0.9965377284981661,-5.0,false,0.15167356
```
- All data within the scope of all SQL statements in the SQL file is exported
to CSV files.
- ```Bash
- # Unix/OS X
- >tools/export-data.sh -t ./data/ -s export.sql
- # Windows
- >tools/export-data.bat -t ./data/ -s export.sql
- ```
+ ```Bash
+ # Unix/OS X
+ >tools/export-data.sh -t ./data/ -s export.sql
+ # Windows
+ >tools/export-data.bat -t ./data/ -s export.sql
+ ```
- Contents of export.sql File (Pointed to by -s Parameter)
```SQL
@@ -113,12 +113,12 @@ SQL Statement Support Rules:
2024-07-22T17:16:02.597+08:00,false
```
- Export Data in SQL File to SQL Statements with Aligned Format
- ```Bash
- # Unix/OS X
- >tools/export-data.sh -h 127.0.0.1 -p 6667 -u root -p root -t ./data/ -s
export.sql -type sql -aligned true
- # Windows
- >tools/export-data.bat -h 127.0.0.1 -p 6667 -u root -p root -t ./data/ -s
export.sql -type sql -aligned true
- ```
+ ```Bash
+ # Unix/OS X
+ >tools/export-data.sh -h 127.0.0.1 -p 6667 -u root -p root -t ./data/ -s
export.sql -type sql -aligned true
+ # Windows
+ >tools/export-data.bat -h 127.0.0.1 -p 6667 -u root -p root -t ./data/ -s
export.sql -type sql -aligned true
+ ```
- Export Results
```Bash
@@ -127,12 +127,12 @@ SQL Statement Support Rules:
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
ALIGNED VALUES
(1722249631835,0.3981064,3.0,0.6254559288663467,-6.0,false,0.9767922);
```
- Export Data in a Certain SQL Execution Range to a CSV File with Specified
Time Format and Data Types
- ```Bash
- # Unix/OS X
- >tools/export-data.sh -t ./data/ -tf 'yyyy-MM-dd HH:mm:ss' -datatype true
-q "select * from root.stock.**" -type csv
- # Windows
- >tools/export-data.bat -t ./data/ -tf 'yyyy-MM-dd HH:mm:ss' -datatype true
-q "select * from root.stock.**" -type csv
- ```
+ ```Bash
+ # Unix/OS X
+ >tools/export-data.sh -t ./data/ -tf 'yyyy-MM-dd HH:mm:ss' -datatype true -q
"select * from root.stock.**" -type csv
+ # Windows
+ >tools/export-data.bat -t ./data/ -tf 'yyyy-MM-dd HH:mm:ss' -datatype true
-q "select * from root.stock.**" -type csv
+ ```
- Export Results
```Bash
@@ -141,11 +141,11 @@ SQL Statement Support Rules:
2024-07-30 10:33:56,0.6880933,3.0,0.6289119476165305,-5.0,false,0.114634395
```
-# import-data Script (Data Import)
+## import-data Script (Data Import)
-## Import File Examples
+### Import File Examples
-### CSV File Example
+#### CSV File Example
Note that before importing CSV data, special characters need to be handled as
follows:
@@ -189,7 +189,7 @@ Time,Device,str(TEXT),var(INT32)
1970-01-01T08:00:00.002+08:00,root.test.t1,hello world,123
```
-### SQL File Example
+#### SQL File Example
> For unsupported SQL, illegal SQL, or failed SQL executions, they will be
> placed in the failed directory under the failed file (default to
> filename.failed).
@@ -200,7 +200,7 @@ INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domai
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
VALUES (1721728581814,0.034122765,4.0,0.9313345284181858,-4.0,true,0.9945297);
```
-## Command
+### Command
```Bash
# Unix/OS X
@@ -225,21 +225,21 @@ CREATE TIMESERIES root.fit.p.s1 WITH
DATATYPE=INT32,ENCODING=RLE;
Parameter Introduction:
-| Parameter
| Definition
[...]
-|:-----------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
-| -h
| Database IP address
[...]
-| -p
| Database port
[...]
-| -u
| Database connection username
[...]
-| -pw
| Database connection password
[...]
-| -s
| Specify the data you want to import, here you can specify a file or folder.
If a folder is specified, all files with the suffix CSV or SQL in the folder
will be imported in bulk.
[...]
-| -fd
| Specify the directory to store the failed SQL files. If this parameter is not
specified, the failed files will be saved to the directory of the source data.
<br/>Note: For unsupported SQL, illegal SQL, and failed SQL, they will be
placed in the failed file in the failed directory (default file name is.
failed)
[...]
-| -aligned
| Specify whether to use the 'aligned' interface, with options of true or
false. <br/>Note: This parameter only takes effect when the imported file is a
CSV file
[...]
-| -batch
| Used to specify the number of points to be inserted for each batch of data
(minimum value is 1, maximum value is Integer.MAX_VALUE). If the program
reports' org.apache.hrift.transport ' If TTransportException: Frame size larger
than protect max size is incorrect, you can adjust this parameter
appropriately.
[...]
-| -tp
| Specify time precision, optional values include 'ms' (milliseconds),' ns'
(nanoseconds), 'us' (microseconds)
[...]
-| -lpf
| Specify the number of lines to write data to each failed import file
[...]
-| -typeInfer
| Used to specify type inference rules. For
Example:<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>.
<br/>Note: Used to specify type inference rules.`srcTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`text`.when`srcTsDataType`is`boolean`,
`dstTsDataType`can only be`boolean`or`text`.when`srcTsDataType`is`NaN`, ` [...]
-
-## Running Examples
+| Parameter
| Definition
[...]
+|:----------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
+| -h
| Database IP address
[...]
+| -p
| Database port
[...]
+| -u
| Database connection username
[...]
+| -pw
| Database connection password
[...]
+| -s
| Specify the data you want to import, here you can specify a file or folder.
If a folder is specified, all files with the suffix CSV or SQL in the folder
will be imported in bulk.
[...]
+| -fd
| Specify the directory to store the failed SQL files. If this parameter is not
specified, the failed files will be saved to the directory of the source data.
<br/>Note: For unsupported SQL, illegal SQL, and failed SQL, they will be
placed in the failed file in the failed directory (default file name is.
failed)
[...]
+| -aligned
| Specify whether to use the 'aligned' interface, with options of true or
false. This parameter only takes effect when the imported file is a CSV file
[...]
+| -batch
| Used to specify the number of points to be inserted for each batch of data
(minimum value is 1, maximum value is Integer.MAX_VALUE). If the program
reports' org.apache.hrift.transport ' If TTransportException: Frame size larger
than protect max size is incorrect, you can adjust this parameter
appropriately.
[...]
+| -tp
| Specify time precision, optional values include 'ms' (milliseconds),' ns'
(nanoseconds), 'us' (microseconds)
[...]
+| -lpf
| Specify the number of lines to write data to each failed import file
[...]
+| -typeInfer
| Used to specify type inference rules. For
Example:<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>.<br/>Note:
Used to specify type inference rules.`srcTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`text`.when`srcTsDataType`is`boolean`,
`dstTsDataType`can only be`boolean`or`text`.when`srcTsDataType`is`NaN`, `ds
[...]
+
+### Running Examples
- Import the `dump0_0.sql` data in the current data directory into the local
IoTDB database.
diff --git a/src/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
b/src/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
index f988a77..6588513 100644
--- a/src/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
+++ b/src/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
@@ -21,7 +21,7 @@
# Data Import Export Script
-IoTDB provides data import and export scripts (tools/export-data,
tools/import-data, supported in versions 1.3.2 and above; for historical
versions, tools/export-csv, tools/import-csv scripts can be used, see the
reference link for usage [Import Export Tool](./TsFile-Import-Export-Tool.md)
), which are used to facilitate the interaction between IoTDB internal data and
external files, suitable for batch operations of single files or directories.
+IoTDB provides data import and export scripts (tools/export-data,
tools/import-data, supported in versions 1.3.2 and above; for historical
versions, tools/export-csv, tools/import-csv scripts can be used, see the
reference link for usage [Document](./TsFile-Import-Export-Tool.md) ), which
are used to facilitate the interaction between IoTDB internal data and external
files, suitable for batch operations of single files or directories.
## Supported Data Formats
@@ -29,9 +29,9 @@ IoTDB provides data import and export scripts
(tools/export-data, tools/import-d
- **CSV** : Plain text format for storing formatted data, which must be
constructed according to the specified CSV format below.
- **SQL** : Files containing custom SQL statements.
-# export-data Script (Data Export)
+## export-data Script (Data Export)
-## Command
+### Command
```Bash
# Unix/OS X
@@ -69,7 +69,7 @@ SQL Statement Support Rules:
| Raw data multi-device query (align by device) | Supported
| select * from root.** align by device |
| Raw data multi-device query (without align by device) | Unsupported
| select * from root.**<br/>select * from root.s_0.* |
-## Running Examples
+### Running Examples
- Export all data within a certain SQL execution range to a CSV file.
```Bash
@@ -141,11 +141,11 @@ SQL Statement Support Rules:
2024-07-30 10:33:56,0.6880933,3.0,0.6289119476165305,-5.0,false,0.114634395
```
-# import-data Script (Data Import)
+## import-data Script (Data Import)
-## Import File Examples
+### Import File Examples
-### CSV File Example
+#### CSV File Example
Note that before importing CSV data, special characters need to be handled as
follows:
@@ -189,7 +189,7 @@ Time,Device,str(TEXT),var(INT32)
1970-01-01T08:00:00.002+08:00,root.test.t1,hello world,123
```
-### SQL File Example
+#### SQL File Example
> For unsupported SQL, illegal SQL, or failed SQL executions, they will be
> placed in the failed directory under the failed file (default to
> filename.failed).
@@ -200,7 +200,7 @@ INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domai
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
VALUES (1721728581814,0.034122765,4.0,0.9313345284181858,-4.0,true,0.9945297);
```
-## Command
+### Command
```Bash
# Unix/OS X
@@ -239,7 +239,7 @@ Parameter Introduction:
| -lpf
| Specify the number of lines to write data to each failed import file
[...]
| -typeInfer
| Used to specify type inference rules. For
Example:<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>.<br/>Note:
Used to specify type inference rules.`srcTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` include
`boolean`,`int`,`long`,`float`,`double`,`text`.when`srcTsDataType`is`boolean`,
`dstTsDataType`can only be`boolean`or`text`.when`srcTsDataType`is`NaN`, `ds
[...]
-## Running Examples
+### Running Examples
- Import the `dump0_0.sql` data in the current data directory into the local
IoTDB database.
diff --git a/src/zh/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
b/src/zh/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
index 30111de..b147626 100644
--- a/src/zh/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
+++ b/src/zh/UserGuide/Master/Tools-System/Data-Import-Export-Tool.md
@@ -21,16 +21,16 @@
# 数据导入导出脚本
-IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data,V1.3.2 及之后版本支持;历史版本可使用
tools/export-csv、tools/import-csv
脚本,使用参考[导入导出工具](./TsFile-Import-Export-Tool.md)),用于实现 IoTDB
内部数据与外部文件的交互,适用于单个文件或目录文件批量操作。
+IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data,V1.3.2 及之后版本支持;历史版本可使用
tools/export-csv、tools/import-csv
脚本,使用参考[文档](./TsFile-Import-Export-Tool.md)),用于实现 IoTDB
内部数据与外部文件的交互,适用于单个文件或目录文件批量操作。
## 支持的数据格式
- **CSV**:纯文本格式,存储格式化数据,需按照下文指定 CSV 格式进行构造
- **SQL**:包含自定义 SQL 语句的文件
-# export-data 脚本(数据导出)
+## export-data 脚本(数据导出)
-## 运行命令
+### 运行命令
```Bash
# Unix/OS X
@@ -68,7 +68,7 @@ IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data
| 原始数据多设备查询(aligin by device) | 支持 | select * from root.** align by
device |
| 原始数据多设备查询(无 aligin by device) | 不支持 | select * from root.**<br/>select *
from root.s_0.* |
-## 运行示例
+### 运行示例
- 导出某 SQL 执行范围下的所有数据至 CSV 文件。
```Bash
@@ -140,11 +140,11 @@ IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data
2024-07-30 10:33:56,0.6880933,3.0,0.6289119476165305,-5.0,false,0.114634395
```
-# import-data 脚本(数据导入)
+## import-data 脚本(数据导入)
-## 导入文件示例
+### 导入文件示例
-### CSV 文件示例
+#### CSV 文件示例
注意,在导入 CSV 数据前,需要特殊处理下列的字符:
@@ -189,7 +189,7 @@ Time,Device,str(TEXT),var(INT32)
1970-01-01T08:00:00.002+08:00,root.test.t1,hello world,123
```
-### SQL 文件示例
+#### SQL 文件示例
> 对于不支持的 SQL ,不合法的 SQL ,执行失败的 SQL 都会放到失败目录下的失败文件里(默认为 文件名.failed)
@@ -200,7 +200,7 @@ INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domai
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
VALUES (1721728581814,0.034122765,4.0,0.9313345284181858,-4.0,true,0.9945297);
```
-## 运行命令
+### 运行命令
```Bash
# Unix/OS X
@@ -239,7 +239,7 @@ CREATE TIMESERIES root.fit.p.s1 WITH
DATATYPE=INT32,ENCODING=RLE;
| -lpf | 指定每个导入失败文件写入数据的行数
| 否 | 10 [...]
| -typeInfer |
用于指定类型推断规则,如<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>。<br/>说明:用于指定类型推断规则.`srcTsDataType`
包括 `boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` 包括
`boolean`,`int`,`long`,`float`,`double`,`text`.当`srcTsDataType`为`boolean`,
`dstTsDataType`只能为`boolean`或`text`.当`srcTsDataType`为`NaN`,
`dstTsDataType`只能为`float`, `double`或`text`.当`srcTsDataType`为数值类型,
`dstTsDataType`的精度需要高于`srcTsDataType`.例如:`-typeInfer boolean=text,float=double`
| 否 | [...]
-## 运行示例
+### 运行示例
- 导入当前`data`目录下的`dump0_0.sql`数据到本机 IoTDB 数据库中。
diff --git a/src/zh/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
b/src/zh/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
index 2416414..3147f4c 100644
--- a/src/zh/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
+++ b/src/zh/UserGuide/latest/Tools-System/Data-Import-Export-Tool.md
@@ -21,16 +21,16 @@
# 数据导入导出脚本
-IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data,V1.3.2
及之后版本支持;历史版本可使用tools/export-csv、tools/import-csv脚本,使用参考[导入导出工具](./TsFile-Import-Export-Tool.md)),用于实现
IoTDB 内部数据与外部文件的交互,适用于单个文件或目录文件批量操作。
+IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data,V1.3.2 及之后版本支持;历史版本可使用
tools/export-csv、tools/import-csv
脚本,使用参考[文档](./TsFile-Import-Export-Tool.md)),用于实现 IoTDB
内部数据与外部文件的交互,适用于单个文件或目录文件批量操作。
## 支持的数据格式
- **CSV**:纯文本格式,存储格式化数据,需按照下文指定 CSV 格式进行构造
- **SQL**:包含自定义 SQL 语句的文件
-# export-data 脚本(数据导出)
+## export-data 脚本(数据导出)
-## 运行命令
+### 运行命令
```Bash
# Unix/OS X
@@ -42,24 +42,24 @@ IoTDB 提供了数据导入导出脚本(tools/export-data、tools/import-data
参数介绍:
-| 参数 | 定义
| 是否必填 | 默认 |
-| :--------
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------|
:----------------------- |
-| -h | 数据库 IP 地址
| 否 | 127.0.0.1 |
-| -p | 数据库端口
| 否 | 6667 |
-| -u | 数据库连接用户名
| 否 | root |
-| -pw | 数据库连接密码
| 否 | root |
-| -t | 导出的 CSV 或 SQL 文件的输出路径
| 是 | |
-| -datatype | 是否在 CSV 文件的 header 中时间序列的后面打印出对应的数据类型,选项为 true 或者 false
| 否 | true |
-| -q | 在命令中直接指定想要执行的查询语句(目前仅支持部分语句,详细明细见下表)<br/>说明:-q 与 -s 参数必填其一,同时填写则
-q 生效。详细支持的 SQL 语句示例,请参考下方“ SQL 语句支持明细”
| 否 | |
-| -s | 指定 SQL 文件,该文件可包含一条或多条 SQL 语句。如果包含多条 SQL 语句,语句之间应该用换行(回车)进行分割。每一条
SQL 语句对应一个或多个输出的 CSV 或 SQL 文件<br/>说明:-q 与 -s 参数必填其一,同时填写则 -q 生效。详细支持的 SQL
语句示例,请参考下方“ SQL 语句支持规则” | 否 | |
-| -type | 指定导出的文件类型,选项为 csv 或者 sql
| 否 | csv |
-| -tf | 指定时间格式。时间格式必须遵守[ISO
8601](https://calendars.wikia.org/wiki/ISO_8601)标准,或时间戳(`timestamp`)<br/>说明:只在
-type 为 csv 时生效 | 否 |
yyyy-MM-dd HH:mm:ss.SSSz |
-| -lpf | 指定导出的 dump 文件最大行数
| 否 | 10000 |
-| -timeout | 指定 session 查询时的超时时间,单位为 ms
| 否 | -1 |
+| 参数 | 定义
| 是否必填 | 默认 |
+| :--------
|:-------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------|
:----------------------- |
+| -h | 数据库IP地址
| 否 | 127.0.0.1 |
+| -p | 数据库端口
| 否 | 6667 |
+| -u | 数据库连接用户名
| 否 | root |
+| -pw | 数据库连接密码
| 否 | root |
+| -t | 导出的 CSV 或 SQL 文件的输出路径
| 是 | |
+| -datatype | 是否在 CSV 文件的 header 中时间序列的后面打印出对应的数据类型,选项为 true 或者 false
| 否 | true |
+| -q | 在命令中直接指定想要执行的查询语句(目前仅支持部分语句,详细明细见下表)<br/>说明:-q 与 -s 参数必填其一,同时填写则
-q 生效。详细支持的 SQL 语句示例,请参考下方“SQL语句支持明细”
| 否 | |
+| -s | 指定 SQL 文件,该文件可包含一条或多条 SQL 语句。如果包含多条 SQL 语句,语句之间应该用换行(回车)进行分割。每一条
SQL 语句对应一个或多个输出的CSV或 SQL 文件<br/>说明:-q 与 -s 参数必填其一,同时填写则-q生效。详细支持的 SQL
语句示例,请参考下方“SQL语句支持规则” | 否 | |
+| -type | 指定导出的文件类型,选项为 csv 或者 sql
| 否 | csv |
+| -tf | 指定时间格式。时间格式必须遵守[ISO
8601](https://calendars.wikia.org/wiki/ISO_8601)标准,或时间戳(`timestamp`)<br/>说明:只在
-type 为 csv 时生效 | 否 |
yyyy-MM-dd HH:mm:ss.SSSz |
+| -lpf | 指定导出的 dump 文件最大行数
| 否 | 10000 |
+| -timeout | 指定 session 查询时的超时时间,单位为ms
| 否 | -1 |
SQL 语句支持规则:
-1. 只支持查询语句,非查询语句(如:元数据管理、系统管理等语句)不支持。对于不支持的 SQL,程序会自动跳过,同时输出错误信息。
+1. 只支持查询语句,非查询语句(如:元数据管理、系统管理等语句)不支持。对于不支持的 SQL ,程序会自动跳过,同时输出错误信息。
2. 查询语句中目前版本仅支持原始数据的导出,如果有使用 group by、聚合函数、udf、操作运算符等则不支持导出为
SQL。原始数据导出时请注意,若导出多个设备数据,请使用 align by device 语句。详细示例如下:
| | 支持导出 | 示例
|
@@ -68,7 +68,7 @@ SQL 语句支持规则:
| 原始数据多设备查询(aligin by device) | 支持 | select * from root.** align by
device |
| 原始数据多设备查询(无 aligin by device) | 不支持 | select * from root.**<br/>select *
from root.s_0.* |
-## 运行示例
+### 运行示例
- 导出某 SQL 执行范围下的所有数据至 CSV 文件。
```Bash
@@ -79,11 +79,11 @@ SQL 语句支持规则:
```
- 导出结果
- ```Bash
-
Time,root.stock.Legacy.0700HK.L1_BidPrice,root.stock.Legacy.0700HK.Type,root.stock.Legacy.0700HK.L1_BidSize,root.stock.Legacy.0700HK.Domain,root.stock.Legacy.0700HK.L1_BuyNo,root.stock.Legacy.0700HK.L1_AskPrice
-
2024-07-29T18:37:18.700+08:00,0.9666617,3.0,0.021367407654674264,-6.0,false,0.8926191
-
2024-07-29T18:37:19.701+08:00,0.3057328,3.0,0.9965377284981661,-5.0,false,0.15167356
- ```
+ ```Bash
+
Time,root.stock.Legacy.0700HK.L1_BidPrice,root.stock.Legacy.0700HK.Type,root.stock.Legacy.0700HK.L1_BidSize,root.stock.Legacy.0700HK.Domain,root.stock.Legacy.0700HK.L1_BuyNo,root.stock.Legacy.0700HK.L1_AskPrice
+
2024-07-29T18:37:18.700+08:00,0.9666617,3.0,0.021367407654674264,-6.0,false,0.8926191
+
2024-07-29T18:37:19.701+08:00,0.3057328,3.0,0.9965377284981661,-5.0,false,0.15167356
+ ```
- 导出 SQL 文件内所有 SQL 执行范围下的所有数据至 CSV 文件。
```Bash
# Unix/OS X
@@ -140,11 +140,11 @@ SQL 语句支持规则:
2024-07-30 10:33:56,0.6880933,3.0,0.6289119476165305,-5.0,false,0.114634395
```
-# import-data 脚本(数据导入)
+## import-data 脚本(数据导入)
-## 导入文件示例
+### 导入文件示例
-### CSV 文件示例
+#### CSV 文件示例
注意,在导入 CSV 数据前,需要特殊处理下列的字符:
@@ -189,9 +189,9 @@ Time,Device,str(TEXT),var(INT32)
1970-01-01T08:00:00.002+08:00,root.test.t1,hello world,123
```
-### SQL 文件示例
+#### SQL 文件示例
-> 对于不支持的 SQL ,不合法的 SQL,执行失败的 SQL 都会放到失败目录下的失败文件里(默认为 文件名.failed)
+> 对于不支持的 SQL ,不合法的 SQL ,执行失败的 SQL 都会放到失败目录下的失败文件里(默认为 文件名.failed)
```SQL
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
VALUES (1721728578812,0.21911979,4.0,0.7129878488375604,-5.0,false,0.65362453);
@@ -200,7 +200,7 @@ INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domai
INSERT INTO
root.stock.Legacy.0700HK(TIMESTAMP,L1_BidPrice,Type,L1_BidSize,Domain,L1_BuyNo,L1_AskPrice)
VALUES (1721728581814,0.034122765,4.0,0.9313345284181858,-4.0,true,0.9945297);
```
-## 运行命令
+### 运行命令
```Bash
# Unix/OS X
@@ -225,21 +225,21 @@ CREATE TIMESERIES root.fit.p.s1 WITH
DATATYPE=INT32,ENCODING=RLE;
参数介绍:
-| 参数 | 定义
[...]
-|:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[...]
-| -h | 数据库IP地址
[...]
-| -p | 数据库端口
[...]
-| -u | 数据库连接用户名
[...]
-| -pw | 数据库连接密码
[...]
-| -s |
指定想要导入的数据,这里可以指定文件或者文件夹。如果指定的是文件夹,将会把文件夹中所有的后缀为csv或者sql的文件进行批量导入。
[...]
-| -fd |
指定存放失败sql文件的目录,如果未指定这个参数,失败的文件将会被保存到源数据的目录中。<br/>说明:对于不支持的 SQL,不合法的 SQL,执行失败的
SQL 都会放到失败目录下的失败文件里(默认为 文件名.failed)
[...]
-| -aligned | 指定是否使用`aligned`接口,选项为 true 或者 false
<br/>说明:这个参数只在导入文件为 csv 文件时生效
[...]
-| -batch |
用于指定每一批插入的数据的点数(最小值为1,最大值为Integer.*MAX_VALUE*)。如果程序报了`org.apache.thrift.transport.TTransportException:
Frame size larger than protect max size`这个错的话,就可以适当的调低这个参数。
[...]
-| -tp | 指定时间精度,可选值包括`ms`(毫秒),`ns`(纳秒),`us`(微秒)
[...]
-| -lpf | 指定每个导入失败文件写入数据的行数
[...]
-| -typeInfer |
用于指定类型推断规则,如<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>。<br/>说明:用于指定类型推断规则.`srcTsDataType`
包括 `boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` 包括
`boolean`,`int`,`long`,`float`,`double`,`text`.当`srcTsDataType`为`boolean`,
`dstTsDataType`只能为`boolean`或`text`.当`srcTsDataType`为`NaN`,
`dstTsDataType`只能为`float`, `double`或`text`.当`srcTsDataType`为数值类型,
`dstTsDataType`的精度需要高于`srcTsDataType`.例如:`-typeInfer boolean=text,float=double`
[...]
-
-## 运行示例
+| 参数 | 定义
| 是否必填 | 默认 [...]
+|:-------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
:------- | : [...]
+| -h | 数据库 IP 地址
| 否 | 12 [...]
+| -p | 数据库端口
| 否 | 66 [...]
+| -u | 数据库连接用户名
| 否 | ro [...]
+| -pw | 数据库连接密码
| 否 | ro [...]
+| -s | 指定想要导入的数据,这里可以指定文件或者文件夹。如果指定的是文件夹,将会把文件夹中所有的后缀为 csv 或者 sql
的文件进行批量导入。
| 是 | [...]
+| -fd | 指定存放失败 SQL 文件的目录,如果未指定这个参数,失败的文件将会被保存到源数据的目录中。<br/>说明:对于不支持的
SQL ,不合法的 SQL ,执行失败的 SQL 都会放到失败目录下的失败文件里(默认为 文件名.failed)
| 否 | 源文 [...]
+| -aligned | 指定是否使用`aligned`接口,选项为 true 或者 false
<br/>说明:这个参数只在导入文件为csv文件时生效
| 否 | fa [...]
+| -batch | 用于指定每一批插入的数据的点数(最小值为1,最大值为
Integer.*MAX_VALUE*)。如果程序报了`org.apache.thrift.transport.TTransportException:
Frame size larger than protect max size`这个错的话,就可以适当的调低这个参数。
| 否 | `1 [...]
+| -tp | 指定时间精度,可选值包括`ms`(毫秒),`ns`(纳秒),`us`(微秒)
| 否 | `m [...]
+| -lpf | 指定每个导入失败文件写入数据的行数
| 否 | 10 [...]
+| -typeInfer |
用于指定类型推断规则,如<srcTsDataType1=dstTsDataType1,srcTsDataType2=dstTsDataType2,...>。<br/>说明:用于指定类型推断规则.`srcTsDataType`
包括 `boolean`,`int`,`long`,`float`,`double`,`NaN`.`dstTsDataType` 包括
`boolean`,`int`,`long`,`float`,`double`,`text`.当`srcTsDataType`为`boolean`,
`dstTsDataType`只能为`boolean`或`text`.当`srcTsDataType`为`NaN`,
`dstTsDataType`只能为`float`, `double`或`text`.当`srcTsDataType`为数值类型,
`dstTsDataType`的精度需要高于`srcTsDataType`.例如:`-typeInfer boolean=text,float=double`
| 否 | [...]
+
+### 运行示例
- 导入当前`data`目录下的`dump0_0.sql`数据到本机 IoTDB 数据库中。