diff --git a/docs/en/14-reference/02-tools/10-taosbenchmark.md b/docs/en/14-reference/02-tools/10-taosbenchmark.md
index 3c1401de68..19f498eab1 100644
--- a/docs/en/14-reference/02-tools/10-taosbenchmark.md
+++ b/docs/en/14-reference/02-tools/10-taosbenchmark.md
@@ -298,11 +298,11 @@ Parameters related to supertable creation are configured in the `super_tables` s
- **csv_ts_interval**: String type, sets the time interval for splitting generated csv file names. Supports daily, hourly, minute, and second intervals such as 1d/2h/30m/40s. The default value is "1d".
-- **csv_output_header**: String type, sets whether the generated csv files should contain column header descriptions. The default value is "true".
+- **csv_output_header**: String type, sets whether the generated csv files should contain column header descriptions. The default value is "yes".
- **csv_tbname_alias**: String type, sets the alias for the tbname field in the column header descriptions of csv files. The default value is "device_id".
-- **csv_compress_level**: String type, sets the compression level when generating csv files and automatically compressing them into gzip format. Possible values are:
+- **csv_compress_level**: String type, sets the compression level for generating csv-encoded data and automatically compressing it into gzip file. This process directly encodes and compresses the data, rather than first generating a csv file and then compressing it. Possible values are:
- none: No compression
- fast: gzip level 1 compression
- balance: gzip level 6 compression
@@ -502,6 +502,17 @@ Note: Data types in the taosBenchmark configuration file must be in lowercase to
+### Export CSV File Example
+
+
+csv-export.json
+
+```json
+{{#include /TDengine/tools/taos-tools/example/csv-export.json}}
+```
+
+
+
Other json examples see [here](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
## Output Performance Indicators
diff --git a/docs/zh/14-reference/02-tools/10-taosbenchmark.md b/docs/zh/14-reference/02-tools/10-taosbenchmark.md
index 9902fa56c9..1f97b0702a 100644
--- a/docs/zh/14-reference/02-tools/10-taosbenchmark.md
+++ b/docs/zh/14-reference/02-tools/10-taosbenchmark.md
@@ -93,7 +93,7 @@ taosBenchmark -f
本节所列参数适用于所有功能模式。
-- **filetype**:功能分类,可选值为 `insert`、`query`、`subscribe` 和 `csvfile`。分别对应插入、查询、订阅和生成csv文件功能。每个配置文件中只能指定其中之一。
+- **filetype**:功能分类,可选值为 `insert`、`query`、`subscribe` 和 `csvfile`。分别对应插入、查询、订阅和生成 csv 文件功能。每个配置文件中只能指定其中之一。
- **cfgdir**:TDengine 客户端配置文件所在的目录,默认路径是 /etc/taos 。
@@ -206,11 +206,11 @@ taosBenchmark -f
- **csv_ts_interval**:字符串类型,设置生成的 csv 文件名称中时间段间隔,支持天、小时、分钟、秒级间隔,如 1d/2h/30m/40s,默认值为 1d 。
-- **csv_output_header**:字符串类型,设置生成的 csv 文件是否包含列头描述,默认值为 true 。
+- **csv_output_header**:字符串类型,设置生成的 csv 文件是否包含列头描述,默认值为 yes 。
- **csv_tbname_alias**:字符串类型,设置 csv 文件列头描述中 tbname 字段的别名,默认值为 device_id 。
-- **csv_compress_level**:字符串类型,设置生成 csv 并自动压缩成 gzip 格式文件的压缩等级。可选值为:
+- **csv_compress_level**:字符串类型,设置生成 csv 编码数据并自动压缩成 gzip 格式文件的压缩等级。此过程直接编码并压缩,而非先生成 csv 文件再压缩。可选值为:
- none:不压缩
- fast:gzip 1级压缩
- balance:gzip 6级压缩
@@ -410,6 +410,17 @@ interval 控制休眠时间,避免持续查询慢查询消耗 CPU,单位为
+### 生成 CSV 文件 JSON 示例
+
+
+csv-export.json
+
+```json
+{{#include /TDengine/tools/taos-tools/example/csv-export.json}}
+```
+
+
+
查看更多 json 配置文件示例可 [点击这里](https://github.com/taosdata/TDengine/tree/main/tools/taos-tools/example)
## 输出性能指标
diff --git a/tests/army/tools/benchmark/basic/csv-export.py b/tests/army/tools/benchmark/basic/csv-export.py
index 702490d6ed..65ffb3e541 100644
--- a/tests/army/tools/benchmark/basic/csv-export.py
+++ b/tests/army/tools/benchmark/basic/csv-export.py
@@ -16,6 +16,7 @@ import csv
import datetime
import frame
+import frame.eos
import frame.etool
from frame.log import *
from frame.cases import *
@@ -213,7 +214,7 @@ class TDTestCase(TBase):
# exec
cmd = f"{benchmark} {options} -f {jsonFile}"
- os.system(cmd)
+ eos.exe(cmd)
# check result
self.check_result(jsonFile)
diff --git a/tests/army/tools/benchmark/basic/json/csv-export.json b/tests/army/tools/benchmark/basic/json/csv-export.json
index 2d6f7b7022..88beab0de1 100644
--- a/tests/army/tools/benchmark/basic/json/csv-export.json
+++ b/tests/army/tools/benchmark/basic/json/csv-export.json
@@ -19,7 +19,7 @@
"childtable_from": 1000,
"childtable_to": 1010,
"csv_file_prefix": "data",
- "csv_output_header": "true",
+ "csv_output_header": "yes",
"csv_tbname_alias": "device_id",
"csv_compress_level": "none",
"columns": [
@@ -59,7 +59,7 @@
"csv_file_prefix": "data",
"csv_ts_format": "%Y%m%d",
"csv_ts_interval": "1d",
- "csv_output_header": "true",
+ "csv_output_header": "yes",
"csv_tbname_alias": "device_id",
"csv_compress_level": "none",
"columns": [
@@ -98,7 +98,7 @@
"childtable_from": 1000,
"childtable_to": 1010,
"csv_file_prefix": "data",
- "csv_output_header": "true",
+ "csv_output_header": "yes",
"csv_tbname_alias": "device_id",
"csv_compress_level": "none",
"columns": [
@@ -139,7 +139,7 @@
"csv_file_prefix": "data",
"csv_ts_format": "%Y%m%d",
"csv_ts_interval": "1d",
- "csv_output_header": "true",
+ "csv_output_header": "yes",
"csv_tbname_alias": "device_id",
"csv_compress_level": "none",
"columns": [
diff --git a/tools/taos-tools/example/csv-export.json b/tools/taos-tools/example/csv-export.json
new file mode 100644
index 0000000000..7fa3e96f2f
--- /dev/null
+++ b/tools/taos-tools/example/csv-export.json
@@ -0,0 +1,54 @@
+{
+ "filetype": "csvfile",
+ "output_path": "./csv/",
+ "databases": [
+ {
+ "dbinfo": {
+ "name": "csvdb",
+ "precision": "ms"
+ },
+ "super_tables": [
+ {
+ "name": "table",
+ "childtable_count": 1010,
+ "insert_rows": 1000,
+ "interlace_rows": 1,
+ "childtable_prefix": "d",
+ "timestamp_step": 1000000,
+ "start_timestamp": "2020-10-01 00:00:00.000",
+ "childtable_from": 1000,
+ "childtable_to": 1010,
+ "csv_file_prefix": "data",
+ "csv_ts_format": "%Y%m%d",
+ "csv_ts_interval": "1d",
+ "csv_output_header": "true",
+ "csv_tbname_alias": "device_id",
+ "csv_compress_level": "none",
+ "columns": [
+ { "type": "bool", "name": "bc"},
+ { "type": "float", "name": "fc", "min": 1},
+ { "type": "double", "name": "dc", "min":10, "max":10},
+ { "type": "tinyint", "name": "ti"},
+ { "type": "smallint", "name": "si"},
+ { "type": "int", "name": "ic", "fillNull":"false"},
+ { "type": "bigint", "name": "bi"},
+ { "type": "utinyint", "name": "uti"},
+ { "type": "usmallint", "name": "usi", "min":100, "max":120},
+ { "type": "uint", "name": "ui"},
+ { "type": "ubigint", "name": "ubi"},
+ { "type": "binary", "name": "bin", "len": 16},
+ { "type": "nchar", "name": "nch", "len": 16}
+ ],
+ "tags": [
+ {"type": "tinyint", "name": "groupid","max": 10,"min": 1},
+ {"type": "binary", "name": "location", "len": 16,
+ "values": ["San Francisco", "Los Angles", "San Diego",
+ "San Jose", "Palo Alto", "Campbell", "Mountain View",
+ "Sunnyvale", "Santa Clara", "Cupertino"]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/tools/taos-tools/src/benchJsonOpt.c b/tools/taos-tools/src/benchJsonOpt.c
index 49b5a6529d..5b992b388e 100644
--- a/tools/taos-tools/src/benchJsonOpt.c
+++ b/tools/taos-tools/src/benchJsonOpt.c
@@ -1434,9 +1434,9 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) {
superTable->csv_output_header = true;
tools_cJSON* oph = tools_cJSON_GetObjectItem(stbInfo, "csv_output_header");
if (oph && oph->type == tools_cJSON_String && oph->valuestring != NULL) {
- if (0 == strcasecmp(oph->valuestring, "yes") || 0 == strcasecmp(oph->valuestring, "true")) {
+ if (0 == strcasecmp(oph->valuestring, "yes")) {
superTable->csv_output_header = true;
- } else if (0 == strcasecmp(oph->valuestring, "no") || 0 == strcasecmp(oph->valuestring, "false")) {
+ } else if (0 == strcasecmp(oph->valuestring, "no")) {
superTable->csv_output_header = false;
}
}