fix: support multi database multi super table insert. case in insertBase.py
This commit is contained in:
parent
6bfc24d4ae
commit
2c901cd4b2
|
@ -448,6 +448,7 @@ class TBase:
|
||||||
dbName = db["dbinfo"]["name"]
|
dbName = db["dbinfo"]["name"]
|
||||||
stbs = db["super_tables"]
|
stbs = db["super_tables"]
|
||||||
for stb in stbs:
|
for stb in stbs:
|
||||||
|
stbName = stb["name"]
|
||||||
child_count = stb["childtable_count"]
|
child_count = stb["childtable_count"]
|
||||||
insert_rows = stb["insert_rows"]
|
insert_rows = stb["insert_rows"]
|
||||||
timestamp_step = stb["timestamp_step"]
|
timestamp_step = stb["timestamp_step"]
|
||||||
|
@ -455,14 +456,14 @@ class TBase:
|
||||||
# check result
|
# check result
|
||||||
|
|
||||||
# count
|
# count
|
||||||
sql = f"select count(*) from {db}.{stb}"
|
sql = f"select count(*) from {dbName}.{stbName}"
|
||||||
tdSql.checkAgg(sql, child_count * insert_rows)
|
tdSql.checkAgg(sql, child_count * insert_rows)
|
||||||
# diff
|
# diff
|
||||||
sql = f"select * from (select diff(ts) as dif from {db}.{stb} partition by tbname) where dif != {timestamp_step};"
|
sql = f"select * from (select diff(ts) as dif from {dbName}.{stbName} partition by tbname) where dif != {timestamp_step};"
|
||||||
tdSql.query(sql)
|
tdSql.query(sql)
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
# show
|
# show
|
||||||
tdLog.info(f"insert check passed. db:{db} stb:{stb} child_count:{child_count} insert_rows:{insert_rows}\n")
|
tdLog.info(f"insert check passed. db:{dbName} stb:{stbName} child_count:{child_count} insert_rows:{insert_rows}\n")
|
||||||
|
|
||||||
# tmq
|
# tmq
|
||||||
def tmqBenchJson(self, jsonFile, options="", checkStep=False):
|
def tmqBenchJson(self, jsonFile, options="", checkStep=False):
|
||||||
|
|
|
@ -120,7 +120,7 @@ class TDTestCase(TBase):
|
||||||
|
|
||||||
def checkInsertManyStb(self):
|
def checkInsertManyStb(self):
|
||||||
# many stb
|
# many stb
|
||||||
self.benchInsert("./tools/benchmark/basic/json/insertManyStb.json", "", True)
|
self.benchInsert("./tools/benchmark/basic/json/insertManyStb.json")
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
benchmark = frame.etool.benchMarkFile()
|
benchmark = frame.etool.benchMarkFile()
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 2,
|
"childtable_count": 2,
|
||||||
"insert_rows": 1000,
|
"insert_rows": 1000,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "da",
|
||||||
"insert_mode": "stmt",
|
"insert_mode": "stmt",
|
||||||
"timestamp_step": 15,
|
"timestamp_step": 15,
|
||||||
"start_timestamp":1700000000000000000,
|
"start_timestamp":1700000000000000,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
||||||
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
||||||
|
@ -41,11 +41,11 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 3,
|
"childtable_count": 3,
|
||||||
"insert_rows": 100,
|
"insert_rows": 100,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "db",
|
||||||
"insert_mode": "stmt",
|
"insert_mode": "stmt",
|
||||||
"timestamp_step": 20,
|
"timestamp_step": 20,
|
||||||
"interlace_rows": 1,
|
"interlace_rows": 1,
|
||||||
"start_timestamp":1700000000000000000,
|
"start_timestamp":1700000000000000,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
||||||
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
||||||
|
@ -61,11 +61,11 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 5,
|
"childtable_count": 5,
|
||||||
"insert_rows": 100,
|
"insert_rows": 100,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "dc",
|
||||||
"insert_mode": "stmt2",
|
"insert_mode": "stmt2",
|
||||||
"timestamp_step": 20,
|
"timestamp_step": 20,
|
||||||
"interlace_rows": 1,
|
"interlace_rows": 1,
|
||||||
"start_timestamp":1700000000000000000,
|
"start_timestamp":1700000000000000,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
||||||
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
||||||
|
@ -81,11 +81,11 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 2,
|
"childtable_count": 2,
|
||||||
"insert_rows": 70,
|
"insert_rows": 70,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "dd",
|
||||||
"insert_mode": "stmt2",
|
"insert_mode": "stmt2",
|
||||||
"timestamp_step": 50,
|
"timestamp_step": 50,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"start_timestamp":1700000000000000000,
|
"start_timestamp":1700000000000000,
|
||||||
"columns": [
|
"columns": [
|
||||||
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
{ "type": "double", "name": "dc", "max": 10, "min": 0 },
|
||||||
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
{ "type": "tinyint", "name": "ti", "max": 100, "min": -100 },
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 3,
|
"childtable_count": 3,
|
||||||
"insert_rows": 120,
|
"insert_rows": 120,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "de",
|
||||||
"insert_mode": "taosc",
|
"insert_mode": "taosc",
|
||||||
"timestamp_step": 15,
|
"timestamp_step": 15,
|
||||||
"start_timestamp":1700000000000000000,
|
"start_timestamp":1700000000000000000,
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
"child_table_exists": "no",
|
"child_table_exists": "no",
|
||||||
"childtable_count": 2,
|
"childtable_count": 2,
|
||||||
"insert_rows": 200,
|
"insert_rows": 200,
|
||||||
"childtable_prefix": "d",
|
"childtable_prefix": "df",
|
||||||
"insert_mode": "taosc",
|
"insert_mode": "taosc",
|
||||||
"timestamp_step": 2,
|
"timestamp_step": 2,
|
||||||
"interlace_rows": 4,
|
"interlace_rows": 4,
|
||||||
|
|
Loading…
Reference in New Issue