Merge pull request #22986 from taosdata/test/3.0/TS-3957
test: add insertFromCsvOfLength65500 case for TS-3957
This commit is contained in:
commit
3dbee70b81
|
@ -0,0 +1,70 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import random
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import taos
|
||||||
|
import subprocess
|
||||||
|
import string
|
||||||
|
from faker import Faker
|
||||||
|
from util.log import tdLog
|
||||||
|
from util.cases import tdCases
|
||||||
|
from util.sql import tdSql
|
||||||
|
from util.dnodes import tdDnodes
|
||||||
|
from util.dnodes import *
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
updatecfgDict = {'maxSQLLength':1048576,'debugFlag': 143 ,"querySmaOptimize":1}
|
||||||
|
|
||||||
|
def init(self, conn, logSql, replicaVar):
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor(), logSql)
|
||||||
|
|
||||||
|
self.testcasePath = os.path.split(__file__)[0]
|
||||||
|
self.testcasePath = self.testcasePath.replace('\\', '//')
|
||||||
|
self.testcaseFilename = os.path.split(__file__)[-1]
|
||||||
|
os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
|
||||||
|
|
||||||
|
now = time.time()
|
||||||
|
self.ts = int(round(now * 1000))
|
||||||
|
self.num = 100
|
||||||
|
|
||||||
|
def insertFromCsvOfLength65500(self):
|
||||||
|
|
||||||
|
tdLog.info('test insert from csv of length 65500')
|
||||||
|
os.system(f"taosBenchmark -f {self.testcasePath}//tableColumn4096.json")
|
||||||
|
|
||||||
|
tdSql.execute(f"insert into db4096.ctb00 file '{self.testcasePath}//tableColumn4096csvLength64k.csv'")
|
||||||
|
tdSql.query("select count(*) from db4096.ctb00")
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
tdSql.query("select length(c4092) from db4096.ctb00")
|
||||||
|
tdSql.checkData(0, 0, 16375)
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
tdSql.prepare()
|
||||||
|
|
||||||
|
startTime_all = time.time()
|
||||||
|
self.insertFromCsvOfLength65500()
|
||||||
|
endTime_all = time.time()
|
||||||
|
print("total time %ds" % (endTime_all - startTime_all))
|
||||||
|
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
|
@ -32,6 +32,7 @@ class TDTestCase:
|
||||||
tdSql.init(conn.cursor(), logSql)
|
tdSql.init(conn.cursor(), logSql)
|
||||||
|
|
||||||
self.testcasePath = os.path.split(__file__)[0]
|
self.testcasePath = os.path.split(__file__)[0]
|
||||||
|
self.testcasePath = self.testcasePath.replace('\\', '//')
|
||||||
self.testcaseFilename = os.path.split(__file__)[-1]
|
self.testcaseFilename = os.path.split(__file__)[-1]
|
||||||
os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
|
os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
|
||||||
|
|
||||||
|
@ -1263,7 +1264,6 @@ class TDTestCase:
|
||||||
|
|
||||||
self.ins_query()
|
self.ins_query()
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
{
|
||||||
|
"filetype": "insert",
|
||||||
|
"cfgdir": "/etc/taos",
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 6030,
|
||||||
|
"rest_port": 6041,
|
||||||
|
"user": "root",
|
||||||
|
"password": "taosdata",
|
||||||
|
"thread_count": 100,
|
||||||
|
"create_table_thread_count": 24,
|
||||||
|
"result_file": "taosBenchmark_result.log",
|
||||||
|
"confirm_parameter_prompt": "no",
|
||||||
|
"insert_interval": 0,
|
||||||
|
"num_of_records_per_req": 1000000,
|
||||||
|
"max_sql_len": 1024000,
|
||||||
|
"databases": [
|
||||||
|
{
|
||||||
|
"dbinfo": {
|
||||||
|
"name": "db4096",
|
||||||
|
"drop": "yes",
|
||||||
|
"replica": 1,
|
||||||
|
"duration": 10,
|
||||||
|
"precision": "ms",
|
||||||
|
"keep": 3650,
|
||||||
|
"comp": 2,
|
||||||
|
"vgroups": 2,
|
||||||
|
"buffer": 1000
|
||||||
|
},
|
||||||
|
"super_tables": [
|
||||||
|
{
|
||||||
|
"name": "stb0",
|
||||||
|
"child_table_exists": "no",
|
||||||
|
"childtable_count": 1,
|
||||||
|
"childtable_prefix": "ctb0",
|
||||||
|
"escape_character": "no",
|
||||||
|
"auto_create_table": "no",
|
||||||
|
"batch_create_tbl_num": 500,
|
||||||
|
"data_source": "rand",
|
||||||
|
"insert_mode": "taosc",
|
||||||
|
"rollup": null,
|
||||||
|
"interlace_rows": 0,
|
||||||
|
"line_protocol": null,
|
||||||
|
"tcp_transfer": "no",
|
||||||
|
"insert_rows": 0,
|
||||||
|
"childtable_limit": 0,
|
||||||
|
"childtable_offset": 0,
|
||||||
|
"rows_per_tbl": 0,
|
||||||
|
"max_sql_len": 1048576,
|
||||||
|
"disorder_ratio": 0,
|
||||||
|
"disorder_range": 1000,
|
||||||
|
"timestamp_step": 1000,
|
||||||
|
"start_timestamp": "2022-10-22 17:20:36",
|
||||||
|
"sample_format": "csv",
|
||||||
|
"sample_file": "./sample.csv",
|
||||||
|
"tags_file": "",
|
||||||
|
"columns": [{ "type": "INT","count": 4090},{"type": "BINARY","len":16374,"count": 2},{"type": "BINARY","len":16375,"count": 1}],
|
||||||
|
"tags": [{"type": "TINYINT", "count": 1},{"type": "NCHAR","count": 1}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"prepare_rand": 10000,
|
||||||
|
"chinese": "no",
|
||||||
|
"streams": false,
|
||||||
|
"test_log": "/root/testlog/"
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue