taosBenchmark
簡介
taosBenchmark 是一個用于 TDengine 的性能測試的應(yīng)用程序。taosBenchmark 可以測試 TDengine 的插入、查詢和訂閱功能,它可以模擬由大量設(shè)備產(chǎn)生的大量數(shù)據(jù),還可以靈活地控制列的數(shù)量,數(shù)據(jù)類型、線程等。以前叫 taosdemo,現(xiàn)在改名為為 taosBenchmark,安裝包提供 taosdemo 作為 taosBenchmark 的軟鏈接。 配置,一種是命令行配置,另一種是JSON文件。
CLI
| 選項(xiàng)名稱 | 描述 |
|---|---|
| -f/--file | JSON 配置文件, 與命令行其他參數(shù)不能同時使用 |
| -c/--config-dir | 配置文件所在的目錄,默認(rèn)路徑是 /etc/taos/ |
| -h/--host | 用于連接 taosd 服務(wù)器的 FQDN,默認(rèn)值為 localhost。 |
| -P/--port | 用于連接 taosd 服務(wù)器的端口號,默認(rèn)值為 6030。 |
| -I/--interface | taosBenchmark 如何插入數(shù)據(jù),默認(rèn)值為 taosc。 |
| -u/--user | 用于連接 taosd 服務(wù)器的用戶名,默認(rèn)值為 root。 |
| -p/--password | 用于連接 taosd 服務(wù)器的密碼,默認(rèn)值為 taosdata。 |
| -o/--output | 指定結(jié)果輸出文件的路徑,默認(rèn)值為 ./output.txt。 |
| -T/--thread | 指定插入數(shù)據(jù)的線程數(shù),默認(rèn)值為 8 |
| -i/--insert-interval | 隔行插入模式的插入間隔,單位為 ms,默認(rèn)值為 0。 |
| -S/--timestampstep | 每個子表中每條記錄的插入時間戳步長,單位是 ms,默認(rèn)值是 1 |
| -B/--interlace-rows | 向子表插入交錯行的數(shù)量 |
| -r/--rec-per-req | 每次插入請求的記錄數(shù),默認(rèn)值為 30000 |
| -t/--tables | 子表的數(shù)量,默認(rèn)值為 10000。 |
| -n/--records | 每個子表插入的記錄數(shù),默認(rèn)值為 10000。 |
| -d/--database | 數(shù)據(jù)庫的名稱,默認(rèn)值為 test。 |
| -l/--columns | 子表的列數(shù),將使用int數(shù)據(jù)類型的列。 |
| -A/--tag-type | 子表的標(biāo)簽的數(shù)據(jù)類型。 |
| -b/--data-type | 子表的列的數(shù)據(jù)類型 |
| -w/--binwidth | 調(diào)整nchar和binary數(shù)據(jù)類型的默認(rèn)長度,默認(rèn)值為 64。 |
| -m/--table-prefix | 子表名稱的前綴,默認(rèn)值為 d |
| -E/--escape-character | 在超級表和子表名稱中使用轉(zhuǎn)義字符,可選。 |
| -C/--chinese | nchar和binary是否基本的Unicode中文字符,可選。 |
| -N/--normal-table | 只創(chuàng)建普通表,不創(chuàng)建超級表,可選。 |
| -M/--random | 數(shù)據(jù)源否使用隨機(jī)的,可選。 |
| -x/--aggr-func | 插入后查詢聚合函數(shù),可選。 |
| -y/--answer-yes | 通過確認(rèn)提示繼續(xù),可選。 |
| -R/--disorder-range | 失序時間戳的范圍,基于數(shù)據(jù)庫的精度,默認(rèn)值為 1000 |
| -O/--disorder | 插入無序時間戳的數(shù)據(jù)的概率,默認(rèn)為 0。 |
| -F/--prepare_rand | 生產(chǎn)隨機(jī)數(shù)據(jù)的隨機(jī)個數(shù),默認(rèn)為10000 |
| -a/--replica | 創(chuàng)建數(shù)據(jù)庫時的副本數(shù)量,默認(rèn)值為 1。 |
| -V/--version | 顯示版本信息并退出 |
| -?/--help | 顯示幫助信息并退出。 |
JSON
1、插入 json 配置文件
{
"filetype": "insert",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"connection_pool_size": 8,
"thread_count": 4,
"result_file": "./insert_res.txt",
"confirm_parameter_prompt": "no",
"insert_interval": 0,
"interlace_rows": 100,
"num_of_records_per_req": 100,
"prepared_rand": 10000,
"chinese":"no",
"databases": [{
"dbinfo": {
"name": "db",
"drop": "yes",
"replica": 1,
"days": 10,
"cache": 16,
"blocks": 8,
"precision": "ms",
"keep": 3650,
"minRows": 100,
"maxRows": 4096,
"comp":2,
"walLevel":1,
"cachelast":0,
"quorum":1,
"fsync":3000,
"update": 0
},
"super_tables": [{
"name": "stb",
"child_table_exists":"no",
"childtable_count": 100,
"childtable_prefix": "stb_",
"escape_character": "yes",
"auto_create_table": "no",
"batch_create_tbl_num": 5,
"data_source": "rand",
"insert_mode": "taosc",
"line_protocol": "line",
"insert_rows": 100000,
"childtable_limit": 10,
"childtable_offset":100,
"interlace_rows": 0,
"insert_interval":0,
"partial_col_num": 0,
"disorder_ratio": 0,
"disorder_range": 1000,
"timestamp_step": 10,
"start_timestamp": "2020-10-01 00:00:00.000",
"sample_format": "csv",
"sample_file": "./sample.csv",
"use_sample_ts": "no",
"tags_file": "",
"columns": [{"type": "INT", "name": "id"}, {"type": "DOUBLE", "count":10}, {"type": "BINARY", "len": 16, "count":3}, {"type": "BINARY", "len": 32, "count":6}],
"tags": [{"type": "TINYINT", "count":2, "max": 10, "min": 98}, {"type": "BINARY", "len": 16, "count":5, "values":["beijing","shanghai"]}]
}]
}]
}
參數(shù)
| 組 | 選項(xiàng)名稱 | 描述 |
|---|---|---|
| filetype | 文件類型,指定哪種測試,對于插入測試,需要為insert。 | |
| cfgdir | taosd 配置文件所在的目錄,默認(rèn)值是 /etc/taos。 | |
| host | taosd 服務(wù)器的 FQDN,默認(rèn)為 localhost。 | |
| port | taosd 服務(wù)器的端口號,默認(rèn)為 6030。 | |
| user | 連接 taosd 服務(wù)器的用戶名,默認(rèn)為 root。 | |
| password | 連接 taosd 服務(wù)器的密碼,默認(rèn)為 taosdata。 | |
| connection_pool_size | taos連接池的大小,默認(rèn)為線程數(shù)。 | |
| thread_count | 插入和創(chuàng)建表的線程數(shù),默認(rèn)為 8。 | |
| result_file | 保存輸出結(jié)果的文件路徑,默認(rèn)為 ./output.txt。 | |
| confirm_parameter_prompt | 在執(zhí)行過程中傳遞確認(rèn)提示,默認(rèn)為無。 | |
| insert_interval | 插入隔行掃描模式的間隔時間,默認(rèn)值為 0 | |
| interlace_rows | 每個子表的交錯行數(shù),默認(rèn)值為 0。 | |
| num_of_records_per_req | 每個請求中的記錄數(shù),默認(rèn)值為 30000。 | |
| prepare_rand | 隨機(jī)產(chǎn)生的數(shù)據(jù)數(shù)量,默認(rèn)值為 10000 | |
| chinese | nchar 和 binary 都是 rand 中文,默認(rèn)值為否。 | |
| dbinfo | name | 數(shù)據(jù)庫名稱,必填 |
| dbinfo | drop | 插入測試前是否刪除數(shù)據(jù)庫,默認(rèn)值為是。 |
| dbinfo | replica | 復(fù)制的數(shù)量,默認(rèn)值是 1。 |
| dbinfo | days | 在文件中存儲數(shù)據(jù)的時間跨度,默認(rèn)值為 10。 |
| dbinfo | cache | 內(nèi)存塊的大小,單位是 MB,默認(rèn)值是 16。 |
| dbinfo | blocks | 每個 vnode(tsdb) 中的緩存大小的內(nèi)存塊的數(shù)量,默認(rèn)值為 6。 |
| dbinfo | precision | 數(shù)據(jù)庫時間精度,默認(rèn)值為 "ms"。 |
| dbinfo | keep | 保留數(shù)據(jù)的天數(shù),默認(rèn)值為 3650。 |
| dbinfo | minRows | 文件塊中的最小記錄數(shù),默認(rèn)值為 100 |
| dbinfo | minRows | 文件塊中的最大記錄數(shù),默認(rèn)值為 4096 |
| dbinfo | comp | 文件壓縮標(biāo)志,默認(rèn)值為 2。 |
| dbinfo | walLevel | wal 級別,默認(rèn)值是 1。 |
| dbinfo | cachelast | 是否允許將每個表的最后一條記錄保留在內(nèi)存中,默認(rèn)值為 0 |
| dbinfo | quorum | 異步寫需要的確認(rèn)次數(shù),默認(rèn)為 1 |
| dbinfo | fsync | 當(dāng) wal 設(shè)置為 2 時,fsync 的間隔時間,單位為 ms,默認(rèn)值為 3000。 |
| dbinfo | update | 是否支持?jǐn)?shù)據(jù)更新,默認(rèn)值為 0。 |
| super_tables | name | 超級表的名稱,必須填寫。 |
| super_tables | child_table_exists | 子表是否已經(jīng)存在,默認(rèn)為否。 |
| super_tables | child_table_count | 子表的數(shù)量,必填 |
| super_tables | childtable_prefix | 子表名稱的前綴,必須填寫。 |
| super_tables | escape_character | 超級表和子表的名稱包括轉(zhuǎn)義字符,默認(rèn)為否。 |
| super_tables | auto_create_table | SQL 語句是否自動創(chuàng)建子表。 |
| Super_tables | batch_create_tbl_num | 為每個請求創(chuàng)建的子表數(shù)量,默認(rèn)為 10。 |
| super_tables | data_source | 數(shù)據(jù)資源類型,選項(xiàng):rand, sample。 |
| super_tables | insert_mode | 插入模式,選項(xiàng):taosc, rest, stmt, sml,默認(rèn)為 taosc。 |
| super_tables | non_stop_mode | 插入模式是否為持續(xù)不停的寫入,默認(rèn)為 no |
| super_tables | line_protocol | 行協(xié)議,可選項(xiàng):line, telnet, json, 默認(rèn)為 line。 |
| super_tables | tcp_transfer | 使用 tcp 還是 http 協(xié)議,默認(rèn)為 http。 |
| super_tables | insert_rows | 每個子表的記錄數(shù),默認(rèn)為 0。 |
| super_tables | childtable_offset | 子表的偏移量。 |
| super_tables | childtable_limit | 插入數(shù)據(jù)的子表數(shù)量。 |
| super_tables | interlace_rows | 每個子表的間隔行,默認(rèn)為 0。 |
| super_tables | insert_interval | 兩個請求之間的插入時間間隔,當(dāng) interlace_rows 大于 0 時有效。 |
| super_tables | partial_col_num | 指定僅向前多少列寫入,默認(rèn)為 0。 |
| super_tables | disorder_ratio | 紊亂時間戳的數(shù)據(jù)比例,默認(rèn)為 0 |
| super_tables | disorder_range | 無序時間戳的范圍,只有當(dāng) disorder_ratio 大于 0 時才有效,默認(rèn)為 1000。 |
| super_tables | timestamp_step | 每條記錄的時間戳步驟,默認(rèn)為 1。 |
| super_tables | start_timestamp | 每個子表的時間戳起始值,默認(rèn)值是 now。 |
| super_tables | sample_format | 樣本數(shù)據(jù)文件的類型,現(xiàn)在只支持 csv。 |
| super_tables | sample_file | 樣本文件,僅當(dāng) data_source 為 "sample "時有效。 |
| super_tables | use_sample_ts | 樣本文件是否包含時間戳,默認(rèn)為否。 |
| super_tables | tags_file | 原理與sample_file相同,標(biāo)簽數(shù)據(jù)樣本文件,僅支持 taosc、rest insert模式。 |
| columns/tags | type | 數(shù)據(jù)類型,必填 |
| columns/tags | len | 數(shù)據(jù)長度,默認(rèn)為 8。 |
| columns/tags | count | 該列的連續(xù)數(shù),默認(rèn)為 1。 |
| columns/tags | name | 這一列的名稱,連續(xù)的列名將是 name_#{number}。 |
| columns/tags | min | 數(shù)字?jǐn)?shù)據(jù)類型列/標(biāo)簽的最小值 |
| columns/tags | max | 數(shù)字?jǐn)?shù)據(jù)類型列/標(biāo)簽的最大值 |
| columns/tags | values | nchar/binary 列/標(biāo)簽的值,將從值中隨機(jī)選擇。 |
2、查詢測試 json 配置文件
{
"filetype": "query",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"confirm_parameter_prompt": "no",
"databases": "db",
"query_times": 2,
"query_mode": "taosc",
"specified_table_query": {
"query_interval": 1,
"concurrent": 3,
"sqls": [
{
"sql": "select last_row(*) from stb0 ",
"result": "./query_res0.txt"
},
{
"sql": "select count(*) from stb00_1",
"result": "./query_res1.txt"
}
]
},
"super_table_query": {
"stblname": "stb1",
"query_interval": 1,
"threads": 3,
"sqls": [
{
"sql": "select last_row(ts) from xxxx",
"result": "./query_res2.txt"
}
]
}
}
查詢測試 JSON 文件的參數(shù)
| 組 | 選項(xiàng) | 描述 | |
|---|---|---|---|
| filetype | 文件類型,指定哪種測試,對于查詢測試,需要 | ||
| cfgdir | taosd 配置文件所在的目錄。 | ||
| host | taosd 服務(wù)器的 FQDN,默認(rèn)為 localhost。 | ||
| port | taosd 服務(wù)器的端口號,默認(rèn)為 6030。 | ||
| user | 連接 taosd 服務(wù)器的用戶名,默認(rèn)為 root。 | ||
| password | 連接 taosd 服務(wù)器的密碼,默認(rèn)為 taosdata。 | ||
| confirm_parameter_prompt | 在執(zhí)行過程中傳遞確認(rèn)提示,默認(rèn)為否。 | ||
| database | 數(shù)據(jù)庫的名稱,需要 | ||
| query_times | 查詢次數(shù) | ||
| query mode | 查詢模式,選項(xiàng):taosc 和 rest,默認(rèn)為 taosc。 | ||
| specified_table_query/super_table_query | query_interval | 查詢時間間隔,單位是秒,默認(rèn)是 0 | |
| specified_table_query/super_table_query | concurrent/threads | 執(zhí)行 SQL 的線程數(shù),默認(rèn)為 1。 | |
| super_table_query | stblname | supertable name, required | 超級表名稱。 |
| sqls | sql | SQL 命令,必填 | |
| sqls | result | 查詢結(jié)果的結(jié)果文件,沒有則為空。 |
3、訂閱 json 配置文件
{
"filetype":"subscribe",
"cfgdir": "/etc/taos",
"host": "127.0.0.1",
"port": 6030,
"user": "root",
"password": "taosdata",
"databases": "db",
"confirm_parameter_prompt": "no",
"specified_table_query":
{
"concurrent":1,
"interval":0,
"restart":"yes",
"keepProgress":"yes",
"sqls": [
{
"sql": "select * from stb00_0 ;",
"result": "./subscribe_res0.txt"
}
]
},
"super_table_query":
{
"stblname": "stb0",
"threads":1,
"interval":10000,
"restart":"yes",
"keepProgress":"yes",
"sqls": [
{
"sql": "select * from xxxx where ts > '2021-02-25 11:35:00.000' ;",
"result": "./subscribe_res1.txt"
}]
}
}
訂閱測試 JSON 文件的參數(shù)
| 組 | 選項(xiàng) | 描述 |
|---|---|---|
| filetype | 文件類型,指定哪種測試,對于訂閱測試,需要 | |
| cfgdir | taosd 配置文件的目錄。 | |
| host | taosd 服務(wù)器的 FQDN,默認(rèn)為 localhost。 | |
| port | taosd 服務(wù)器的端口號,默認(rèn)為 6030。 | |
| user | 連接 taosd 服務(wù)器的用戶名,默認(rèn)為 root。 | |
| password | 連接 taosd 服務(wù)器的密碼,默認(rèn)為 taosdata。 | |
| databases | 數(shù)據(jù)庫名稱,需要 | |
| confirm_parameter_prompt | 在執(zhí)行過程中是否通過確認(rèn)提示。 | |
| specified_table_query/super_table_query | concurrent/threads | 執(zhí)行 SQL 的線程數(shù),默認(rèn)為 1。 |
| specified_table_query/super_table_query | interval | 執(zhí)行訂閱的時間間隔,默認(rèn)為 0。 |
| specified_table_query/super_table_query | restart | no: 繼續(xù)之前的訂閱,yes: 開始新的訂閱。 |
| specified_table_query/super_table_query | keepProgress | 是否保留訂閱的進(jìn)度。 |
| specified_table_query/super_table_query | resubAfterConsume | 是否取消訂閱,然后再次訂閱? |
| super_table_query | stblname | supertable 的名稱,必須的。 |
| sqls | sql | SQL 命令,必填 |
| sqls | result | 查詢結(jié)果的結(jié)果文件,沒有則為空。 |
參數(shù)具體說明
返回
insert mode
可選項(xiàng)有taosc, rest, stmt, sml, sml-rest, 分別對應(yīng)c接口,restful,參數(shù)綁定,schemaless的c接口,taosAdapter schemaless寫入
insert interval
只有當(dāng)interlace rows大于0時才起作用。 意味著線程在為每個子表插入隔行掃描記錄后,會等待該值的時間再進(jìn)行下一輪寫入。
partial col num
若該值為 5, 則僅向前 5 列寫入,僅當(dāng) insert_mode 為 taosc 和 rest 時生效,為 0 則是向全部列寫入。
batch create tbl num
創(chuàng)建子表時的批數(shù),默認(rèn)為 10。
注:實(shí)際的批數(shù)不一定與該值相同,當(dāng)執(zhí)行的 SQL 語句大于支持的最大長度時,會自動截?cái)嘣賵?zhí)行,繼續(xù)創(chuàng)建。
auto create table
僅當(dāng) insert_mode 為 taosc, rest, stmt 時 并且 childtable_exists 為 ”no“ 時生效,此參數(shù)表示執(zhí)行寫入的 SQL 語句,若為 “yes” 則為 insert into tb using stb tags (xxx,xxx,...) values (xxx,xxx,...) 這樣的格式,若為 “no“ 則為 insert into tb values (xxx,xxx,...) 這樣的格式,前者不需要提前建立子表,后者需要。
interlace rows
如果它的值為 0,意味著逐個子表逐個子表插入,如果它的值大于零,比如5,將首先插入 到第一個子表的5條記錄,然后是第二個子表5條記錄、然后第三個,以此類推。當(dāng)所有的子表都寫入5條記錄后,線程將從第一個子表繼續(xù)寫入,以此類推。
record per request
每次插入數(shù)據(jù)請求/調(diào)用api時包含的數(shù)據(jù)行數(shù),也是批次數(shù),當(dāng)批次數(shù)過大時,taos客戶端會返回相應(yīng)的錯誤信息,此時需要調(diào)整這個數(shù)來滿足寫入要求。
columns
如果同時設(shè)置了該參數(shù)和-b/--data-type,會比較該參數(shù)與-b/--data-type設(shè)置的列類型的列的個數(shù),如果前者大于后者,比如: -l 5 -b float,double, 那么最后的列為 FLOAT,DOUBLE,INT,INT,INT。如果前者小于等于后者,比如: -l 3 -b float,double,float,bigint,那么最后的列為 FLOAT,DOUBLE,FLOAT,BIGINT。
tag type
設(shè)置超級表的標(biāo)簽類型,nchar 和 binary 也可以設(shè)置長度,例如:
taosBenchmark -A INT,DOUBLE,NCHAR,BINARY(16)
默認(rèn)是INT,BINARY(16)。
注意:在有的 shell 比如 bash 命令里面 “()” 需要轉(zhuǎn)義,則上述指令應(yīng)為:
taosBenchmark -A INT,DOUBLE,NCHAR,BINARY\(16\)
data type
與-A/--tag-type相同,但用于列,默認(rèn)為FLOAT,INT,FLOAT
random
默認(rèn)的情況下,數(shù)據(jù)是模擬電表的采集點(diǎn)的數(shù)據(jù),數(shù)據(jù)值有特定的大小范圍,若配置次參數(shù),數(shù)據(jù)將隨機(jī)從支持最大的正負(fù)32位整數(shù)中產(chǎn)生。若有修改表結(jié)構(gòu)的其他參數(shù),如 -l, -b, -A等...,將自動使用從支持最大的正負(fù)32位整數(shù)內(nèi)隨機(jī)產(chǎn)生的數(shù)據(jù)。
disorder ratio
隨機(jī)亂序時間戳的概率,最大為50,即為50%。隨機(jī)的亂序時間戳為當(dāng)前應(yīng)插入數(shù)據(jù)的時間戳倒退隨機(jī)disorder-range內(nèi)的時間戳。
disorder range
只有當(dāng)-O/--disorder大于0時才有效,單位與數(shù)據(jù)庫的時間精確度相同。
prepared rand
作為數(shù)據(jù)源預(yù)先生成的隨機(jī)數(shù)據(jù)的數(shù)量,小的prepare_rand 會節(jié)省內(nèi)存,但會減少數(shù)據(jù)種類。若為1,則生成的所有同類型的數(shù)據(jù)相同。
connection pool size
所有與taos c客戶端相關(guān)的交互都需要 taos 實(shí)例,實(shí)例會預(yù)先創(chuàng)建,以防止運(yùn)行過程中由于中斷導(dǎo)致的失敗,該值決定taos實(shí)例預(yù)先創(chuàng)建的數(shù)量。若不配置,則與線程數(shù)相同。
data source
數(shù)據(jù)的來源,默認(rèn)為 taosBenchmark 隨機(jī)產(chǎn)生,可以配置為 sample,即為使用 sample_file 參數(shù)指定的文件內(nèi)的數(shù)據(jù)。
line protocol
行協(xié)議,僅當(dāng) insert_mode 為 sml 與 sml-rest 時生效,可選項(xiàng)為 line, telnet, json。
non stop mode
寫入模式是否為不停的持續(xù)寫入,若為 “yes” 則 insert_rows 失效,直到 Ctrl + C 停止程序,寫入才會停止。
注:即使 insert_rows 失效,但是也必須是一個非零正整數(shù)。
tcp transfer
僅當(dāng) insert_mode 為 sml-rest 并且 line_protocol 為 telnet 時生效,支持兩種通訊協(xié)議: tcp 與 http, 默認(rèn)為 http。
normal table
僅當(dāng) insert_mode 為 taosc, stmt, rest 模式下可以使用,不創(chuàng)建超級表,只創(chuàng)建普通表。
childtable limit
僅當(dāng) childtable_exists 為 yes 時生效,為使用語句
select tbname from stable limit x offset y;
中的limit的值 x,即為獲取插入的現(xiàn)有的子表數(shù)量。
childtable offset
僅當(dāng) childtable_exists 為 yes 時生效,為使用語句
select tbname from stable limit x offset y;
中的 offset的值y,即為獲取插入子表的偏移量。
sample file
是否使用以 csv 格式的數(shù)據(jù)作為數(shù)據(jù)源,僅當(dāng)data_source 為 sample 時生效。
注:這里與最終生成的數(shù)據(jù)不同,最終數(shù)據(jù)源的數(shù)據(jù)與prepared_rand的值有關(guān),若 csv 文件內(nèi)的數(shù)據(jù)行數(shù)小于prepared_rand,那么會循環(huán)讀取 csv 文件數(shù)據(jù)直到與prepared_rand相同,若大于,則會只讀取 prepared_rand 個數(shù)的行的數(shù)據(jù)。
use sample ts
僅當(dāng) data_source 為 sample 時生效,sample_file 指定的 csv 文件內(nèi)是否包含第一列時間戳,默認(rèn)為 no, 若為yes, 則使用 csv 文件第一列的時間戳,由于同一子表時間戳不能重復(fù),生成的數(shù)據(jù)個數(shù)必須與 csv 文件內(nèi)的數(shù)據(jù)行數(shù)相同,此時 insert_rows 失效。
tags file
僅當(dāng) insert_mode 為 taosc, rest 的模式下生效。
注:這里原理與 sample-file 類似,最終的 tag 的數(shù)值與 childtable_count 有關(guān),如果 csv 文件內(nèi)的 tag 數(shù)據(jù)行小于給定的子表數(shù)量,那么會循環(huán)讀取 csv 文件數(shù)據(jù)直到與子表數(shù)量相同,若大于,則只會讀取 childtable_count 行 tag 數(shù)據(jù)。
type
可選值請參考官方支持的數(shù)據(jù)類型(http://www.fjzmyy.cn/docs/cn/v2.0/taos-sql#data-type)。
注:JSON 數(shù)據(jù)類型比較特殊,只有在 tags 里面可以選擇,并且有且僅有一列 JSON tag 才可以,此時 count 和 len 代表的意義分別是 JSON tag 內(nèi)的 key-value pair 的個數(shù)和每個KV pair 的 value的值的長度,value默認(rèn)為string。
count
該列連續(xù)的個數(shù),比如我們想測試4096個列的性能時,不用羅列出 4096 個列來表示,直接使用 "count": 4096 即可。
len
該數(shù)據(jù)類型的長度,對 NCHAR,BINARY 和 JSON 數(shù)據(jù)類型有效,若對其他數(shù)據(jù)類型配置,若為 0 , 則代表這列始終都是以 null 值寫入,若為其他數(shù),則沒有意義,不建議配置。
name
列的名字,若與count同時使用,比如 "name":"current", "count":3, 則 3 個列的名字分別為 current, current_2. current_3
sql
對于超級表的查詢 SQL,在 SQL 命令中保留 "xxxx",程序會自動將其替換為超級表的所有子表名。 替換為超級表中所有的子表名。

