fix: taosbenchmark schemaless refine (#19721)
* fix: optimize taosbenchmark data preparing for sml json * fix: update taos-tools 5c5e79f * fix: update taos-tools 298a30d * fix: taos-tools 143b9e4 * fix: update taos-tools 0b56d15 * fix: update taos-tools 7375f23 * fix: update taos-tools eaf2309 * fix: update taos-tools 723f696 * fix: update taos-tools c9be106 * fix: update taos-tools 9b8975b * test: update taos-tools 3309b9d * test: update taos-tools d93cd23 * fix: update taos-tools 6632796 * fix: update taos-tools bd43034 * test: fix sml_json_alltyps.py according to taosbenchmark change * test: fix sml_json_alltypes test case * fix: update taos-tools 181bcac
This commit is contained in:
parent
fc829aec52
commit
1bcc2d52fb
|
@ -2,7 +2,7 @@
|
||||||
# taos-tools
|
# taos-tools
|
||||||
ExternalProject_Add(taos-tools
|
ExternalProject_Add(taos-tools
|
||||||
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
|
||||||
GIT_TAG 0cd564a
|
GIT_TAG 181bcac
|
||||||
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
|
||||||
BINARY_DIR ""
|
BINARY_DIR ""
|
||||||
#BUILD_IN_SOURCE TRUE
|
#BUILD_IN_SOURCE TRUE
|
||||||
|
|
|
@ -16,13 +16,7 @@
|
||||||
"databases": [{
|
"databases": [{
|
||||||
"dbinfo": {
|
"dbinfo": {
|
||||||
"name": "db",
|
"name": "db",
|
||||||
"drop": "yes",
|
"drop": "yes"
|
||||||
"replica": 1,
|
|
||||||
"precision": "ms",
|
|
||||||
"keep": 36500,
|
|
||||||
"minRows": 100,
|
|
||||||
"maxRows": 4096,
|
|
||||||
"comp":2
|
|
||||||
},
|
},
|
||||||
"super_tables": [{
|
"super_tables": [{
|
||||||
"name": "stb1",
|
"name": "stb1",
|
||||||
|
@ -37,7 +31,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -62,7 +56,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -87,7 +81,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -112,7 +106,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -137,7 +131,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -162,7 +156,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -187,7 +181,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -212,7 +206,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
@ -237,7 +231,7 @@
|
||||||
"line_protocol": "json",
|
"line_protocol": "json",
|
||||||
"childtable_limit": 0,
|
"childtable_limit": 0,
|
||||||
"childtable_offset": 0,
|
"childtable_offset": 0,
|
||||||
"insert_rows": 10,
|
"insert_rows": 20,
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"interlace_rows": 0,
|
"interlace_rows": 0,
|
||||||
"disorder_ratio": 0,
|
"disorder_ratio": 0,
|
||||||
|
|
|
@ -19,32 +19,38 @@ from util.dnodes import *
|
||||||
|
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
def caseDescription(self):
|
def caseDescription(self):
|
||||||
'''
|
"""
|
||||||
[TD-11510] taosBenchmark test cases
|
[TD-11510] taosBenchmark test cases
|
||||||
'''
|
"""
|
||||||
return
|
|
||||||
|
|
||||||
def init(self, conn, logSql, replicaVar=1):
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
self.replicaVar = int(replicaVar)
|
|
||||||
tdLog.debug("start to execute %s" % __file__)
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
self.replicaVar = int(replicaVar)
|
||||||
tdSql.init(conn.cursor(), logSql)
|
tdSql.init(conn.cursor(), logSql)
|
||||||
|
|
||||||
def getPath(self, tool="taosBenchmark"):
|
def getPath(self, tool="taosBenchmark"):
|
||||||
selfPath = os.path.dirname(os.path.realpath(__file__))
|
selfPath = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
if ("community" in selfPath):
|
if "community" in selfPath:
|
||||||
projPath = selfPath[:selfPath.find("community")]
|
projPath = selfPath[: selfPath.find("community")]
|
||||||
|
elif "src" in selfPath:
|
||||||
|
projPath = selfPath[: selfPath.find("src")]
|
||||||
|
elif "/tools/" in selfPath:
|
||||||
|
projPath = selfPath[: selfPath.find("/tools/")]
|
||||||
|
elif "/tests/" in selfPath:
|
||||||
|
projPath = selfPath[: selfPath.find("/tests/")]
|
||||||
else:
|
else:
|
||||||
projPath = selfPath[:selfPath.find("tests")]
|
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
|
||||||
|
projPath = "/usr/local/taos/bin/"
|
||||||
|
|
||||||
paths = []
|
paths = []
|
||||||
for root, dirs, files in os.walk(projPath):
|
for root, dummy, files in os.walk(projPath):
|
||||||
if ((tool) in files):
|
if (tool) in files:
|
||||||
rootRealPath = os.path.dirname(os.path.realpath(root))
|
rootRealPath = os.path.dirname(os.path.realpath(root))
|
||||||
if ("packaging" not in rootRealPath):
|
if "packaging" not in rootRealPath:
|
||||||
paths.append(os.path.join(root, tool))
|
paths.append(os.path.join(root, tool))
|
||||||
break
|
break
|
||||||
if (len(paths) == 0):
|
if len(paths) == 0:
|
||||||
tdLog.exit("taosBenchmark not found!")
|
tdLog.exit("taosBenchmark not found!")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
|
@ -52,49 +58,63 @@ class TDTestCase:
|
||||||
return paths[0]
|
return paths[0]
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
tdSql.query("select client_version()")
|
||||||
|
client_ver = "".join(tdSql.queryResult[0])
|
||||||
|
major_ver = client_ver.split(".")[0]
|
||||||
|
|
||||||
binPath = self.getPath()
|
binPath = self.getPath()
|
||||||
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" %binPath
|
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" % binPath
|
||||||
tdLog.info("%s" % cmd)
|
tdLog.info("%s" % cmd)
|
||||||
os.system("%s" % cmd)
|
os.system("%s" % cmd)
|
||||||
tdSql.execute("reset query cache")
|
tdSql.execute("reset query cache")
|
||||||
tdSql.query("describe db.stb1")
|
tdSql.query("describe db.stb1")
|
||||||
tdSql.checkData(1, 1, "BOOL")
|
tdSql.checkData(1, 1, "BOOL")
|
||||||
tdSql.query("describe db.stb2")
|
tdSql.query("describe db.stb2")
|
||||||
tdSql.checkData(1, 1, "TINYINT")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb3")
|
tdSql.query("describe db.stb3")
|
||||||
tdSql.checkData(1, 1, "SMALLINT")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb4")
|
tdSql.query("describe db.stb4")
|
||||||
tdSql.checkData(1, 1, "INT")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb5")
|
tdSql.query("describe db.stb5")
|
||||||
tdSql.checkData(1, 1, "BIGINT")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb6")
|
tdSql.query("describe db.stb6")
|
||||||
tdSql.checkData(1, 1, "FLOAT")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb7")
|
tdSql.query("describe db.stb7")
|
||||||
tdSql.checkData(1, 1, "DOUBLE")
|
tdSql.checkData(1, 1, "DOUBLE")
|
||||||
tdSql.query("describe db.stb8")
|
tdSql.query("describe db.stb8")
|
||||||
|
if major_ver == "3":
|
||||||
tdSql.checkData(1, 1, "VARCHAR")
|
tdSql.checkData(1, 1, "VARCHAR")
|
||||||
tdSql.checkData(1, 2, 16)
|
tdSql.checkData(1, 2, 16)
|
||||||
tdSql.query("describe db.stb9")
|
else:
|
||||||
tdSql.checkData(1, 1, "NCHAR")
|
tdSql.checkData(1, 1, "NCHAR")
|
||||||
|
tdSql.checkData(1, 2, 8)
|
||||||
|
|
||||||
|
tdSql.query("describe db.stb9")
|
||||||
|
if major_ver == "3":
|
||||||
|
tdSql.checkData(1, 1, "VARCHAR")
|
||||||
tdSql.checkData(1, 2, 16)
|
tdSql.checkData(1, 2, 16)
|
||||||
|
else:
|
||||||
|
tdSql.checkData(1, 1, "NCHAR")
|
||||||
|
tdSql.checkData(1, 2, 8)
|
||||||
|
|
||||||
tdSql.query("select count(*) from db.stb1")
|
tdSql.query("select count(*) from db.stb1")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb2")
|
tdSql.query("select count(*) from db.stb2")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb3")
|
tdSql.query("select count(*) from db.stb3")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb4")
|
tdSql.query("select count(*) from db.stb4")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb5")
|
tdSql.query("select count(*) from db.stb5")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb6")
|
tdSql.query("select count(*) from db.stb6")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb7")
|
tdSql.query("select count(*) from db.stb7")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb8")
|
tdSql.query("select count(*) from db.stb8")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
tdSql.query("select count(*) from db.stb9")
|
tdSql.query("select count(*) from db.stb9")
|
||||||
tdSql.checkData(0, 0, 80)
|
tdSql.checkData(0, 0, 160)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
|
|
Loading…
Reference in New Issue