update abs for improve

This commit is contained in:
wenzhouwww@live.cn 2022-06-22 15:04:09 +08:00
parent 557d69d14a
commit 92f27e683c
1 changed files with 273 additions and 258 deletions

View File

@ -6,14 +6,62 @@ import inspect
from util.log import *
from util.sql import *
from util.cases import *
import random
class TDTestCase:
updatecfgDict = {'debugFlag': 143, "cDebugFlag": 143, "uDebugFlag": 143, "rpcDebugFlag": 143, "tmrDebugFlag": 143,
"jniDebugFlag": 143, "simDebugFlag": 143, "dDebugFlag": 143, "dDebugFlag": 143, "vDebugFlag": 143, "mDebugFlag": 143, "qDebugFlag": 143,
"wDebugFlag": 143, "sDebugFlag": 143, "tsdbDebugFlag": 143, "tqDebugFlag": 143, "fsDebugFlag": 143, "fnDebugFlag": 143}
def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), True)
self.tb_nums = 10
self.row_nums = 20
self.ts = 1434938400000
self.time_step = 1000
def insert_datas_and_check_abs(self ,tbnums , rownums , time_step ):
tdLog.info(" prepare datas for auto check abs function ")
tdSql.execute(" create database test ")
tdSql.execute(" use test ")
tdSql.execute(" create stable stb (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint,\
c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) tags (t1 int)")
for tbnum in range(tbnums):
tbname = "sub_tb_%d"%tbnum
tdSql.execute(" create table %s using stb tags(%d) "%(tbname , tbnum))
ts = self.ts
for row in range(rownums):
ts += time_step*row
c1 = random.randint(0,10000)
c2 = random.randint(0,100000)
c3 = random.randint(0,125)
c4 = random.randint(0,125)
c5 = random.random()/1.0
c6 = random.random()/1.0
c7 = "'true'"
c8 = "'binary_val'"
c9 = "'nchar_val'"
c10 = ts
tdSql.execute(f" insert into {tbname} values ({ts},{c1},{c2},{c3},{c4},{c5},{c6},{c7},{c8},{c9},{c10})")
tdSql.execute("use test")
tbnames = ["stb", "sub_tb_1"]
support_types = ["BIGINT", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE", "INT"]
for tbname in tbnames:
tdSql.query("desc {}".format(tbname))
coltypes = tdSql.queryResult
for coltype in coltypes:
colname = coltype[0]
abs_sql = "select abs({}) from {} order by tbname ".format(colname, tbname)
origin_sql = "select {} from {} order by tbname".format(colname, tbname)
if coltype[1] in support_types:
self.check_result_auto(origin_sql , abs_sql)
def prepare_datas(self):
tdSql.execute(
@ -39,14 +87,21 @@ class TDTestCase:
tdSql.execute(
f"insert into ct4 values ( now()-{i*90}d, {1*i}, {11111*i}, {111*i}, {11*i}, {1.11*i}, {11.11*i}, {i%2}, 'binary{i}', 'nchar{i}', now()+{1*i}a )"
)
tdSql.execute("insert into ct1 values (now()-45s, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar0', now()+8a )")
tdSql.execute("insert into ct1 values (now()+10s, 9, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct1 values (now()+15s, 9, -99999, -999, -99, -9.99, NULL, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct1 values (now()+20s, 9, -99999, -999, NULL, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()-45s, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar0', now()+8a )")
tdSql.execute(
"insert into ct1 values (now()+10s, 9, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()+15s, 9, -99999, -999, -99, -9.99, NULL, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()+20s, 9, -99999, -999, NULL, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct4 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute("insert into ct4 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute("insert into ct4 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
f'''insert into t1 values
@ -65,10 +120,10 @@ class TDTestCase:
'''
)
def prepare_tag_datas(self):
# prepare datas
tdSql.execute("create database if not exists testdb keep 3650 duration 1000")
tdSql.execute(
"create database if not exists testdb keep 3650 duration 1000")
tdSql.execute(" use testdb ")
tdSql.execute(
'''create table stb1
@ -84,7 +139,8 @@ class TDTestCase:
'''
)
for i in range(4):
tdSql.execute(f'create table ct{i+1} using stb1 tags ( now(), {1*i}, {11111*i}, {111*i}, {11*i}, {1.11*i}, {11.11*i}, {i%2}, "binary{i}", "nchar{i}" )')
tdSql.execute(
f'create table ct{i+1} using stb1 tags ( now(), {1*i}, {11111*i}, {111*i}, {11*i}, {1.11*i}, {11.11*i}, {i%2}, "binary{i}", "nchar{i}" )')
for i in range(9):
tdSql.execute(
@ -93,14 +149,21 @@ class TDTestCase:
tdSql.execute(
f"insert into ct4 values ( now()-{i*90}d, {1*i}, {11111*i}, {111*i}, {11*i}, {1.11*i}, {11.11*i}, {i%2}, 'binary{i}', 'nchar{i}', now()+{1*i}a )"
)
tdSql.execute("insert into ct1 values (now()-45s, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar0', now()+8a )")
tdSql.execute("insert into ct1 values (now()+10s, 9, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct1 values (now()+15s, 9, -99999, -999, -99, -9.99, NULL, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct1 values (now()+20s, 9, -99999, -999, NULL, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()-45s, 0, 0, 0, 0, 0, 0, 0, 'binary0', 'nchar0', now()+8a )")
tdSql.execute(
"insert into ct1 values (now()+10s, 9, -99999, -999, -99, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()+15s, 9, -99999, -999, -99, -9.99, NULL, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute(
"insert into ct1 values (now()+20s, 9, -99999, -999, NULL, -9.99, -99.99, 1, 'binary9', 'nchar9', now()+9a )")
tdSql.execute("insert into ct4 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute("insert into ct4 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute("insert into ct4 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
"insert into ct4 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(
f'''insert into t1 values
@ -143,16 +206,18 @@ class TDTestCase:
if auto_result[row_index][col_index] != elem:
check_status = False
if not check_status:
tdLog.notice("abs function value has not as expected , sql is \"%s\" "%abs_query )
tdLog.notice(
"abs function value has not as expected , sql is \"%s\" " % abs_query)
sys.exit(1)
else:
tdLog.info("abs value check pass , it work as expected ,sql is \"%s\" "%abs_query )
tdLog.info(
"abs value check pass , it work as expected ,sql is \"%s\" " % abs_query)
def test_errors(self):
tdSql.execute("use testdb")
error_sql_lists = [
"select abs from t1",
# "select abs(-+--+c1) from t1",
"select abs(-+--+c1) from t1",
# "select +-abs(c1) from t1",
# "select ++-abs(c1) from t1",
# "select ++--abs(c1) from t1",
@ -185,86 +250,18 @@ class TDTestCase:
def support_types(self):
tdSql.execute("use testdb")
type_error_sql_lists = [
"select abs(ts) from t1" ,
"select abs(t0) from t1" ,
"select abs(c7) from t1",
"select abs(c8) from t1",
"select abs(c9) from t1",
"select abs(t7) from t1",
"select abs(t8) from t1",
"select abs(t9) from t1",
"select abs(ts) from ct1" ,
"select abs(c7) from ct1",
"select abs(c8) from ct1",
"select abs(c9) from ct1",
"select abs(ts) from ct3" ,
"select abs(c7) from ct3",
"select abs(c8) from ct3",
"select abs(c9) from ct3",
"select abs(ts) from ct4" ,
"select abs(c7) from ct4",
"select abs(c8) from ct4",
"select abs(c9) from ct4",
"select abs(ts) from stb1" ,
"select abs(c7) from stb1",
"select abs(c8) from stb1",
"select abs(c9) from stb1" ,
"select abs(ts) from stbbb1" ,
"select abs(c7) from stbbb1",
"select abs(ts) from tbname",
"select abs(c9) from tbname"
]
for type_sql in type_error_sql_lists:
tdSql.error(type_sql)
type_sql_lists = [
"select abs(c1) from t1",
"select abs(c2) from t1",
"select abs(c3) from t1",
"select abs(c4) from t1",
"select abs(c5) from t1",
"select abs(c6) from t1",
"select abs(t1) from ct1",
"select abs(t2) from ct1",
"select abs(t3) from ct1",
"select abs(t4) from ct1",
"select abs(t5) from ct1",
"select abs(t6) from ct1",
"select abs(c1) from ct1",
"select abs(c2) from ct1",
"select abs(c3) from ct1",
"select abs(c4) from ct1",
"select abs(c5) from ct1",
"select abs(c6) from ct1",
"select abs(c1) from ct3",
"select abs(c2) from ct3",
"select abs(c3) from ct3",
"select abs(c4) from ct3",
"select abs(c5) from ct3",
"select abs(c6) from ct3",
"select abs(c1) from stb1",
"select abs(c2) from stb1",
"select abs(c3) from stb1",
"select abs(c4) from stb1",
"select abs(c5) from stb1",
"select abs(c6) from stb1",
"select abs(c6) as alisb from stb1",
"select abs(c6) alisb from stb1",
]
for type_sql in type_sql_lists:
tdSql.query(type_sql)
tbnames = ["stb1", "t1", "ct1", "ct2"]
support_types = ["BIGINT", "SMALLINT", "TINYINT", "FLOAT", "DOUBLE", "INT"]
for tbname in tbnames:
tdSql.query("desc {}".format(tbname))
coltypes = tdSql.queryResult
for coltype in coltypes:
colname = coltype[0]
abs_sql = "select abs({}) from {}".format(colname, tbname)
if coltype[1] in support_types:
tdSql.query(abs_sql)
else:
tdSql.error(abs_sql)
def basic_abs_function(self):
@ -305,7 +302,8 @@ class TDTestCase:
tdSql.checkData(3, 4, 33)
tdSql.checkData(5, 5, None)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from t1", "select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from t1")
self.check_result_auto("select c1, c2, c3 , c4, c5 from t1",
"select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from t1")
# used for sub table
tdSql.query("select abs(c1) from ct1")
@ -315,16 +313,19 @@ class TDTestCase:
tdSql.checkData(5, 0, 4)
tdSql.query("select abs(c1) from ct1")
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct1", "select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from ct1")
self.check_result_auto("select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from ct1;","select c1 from ct1" )
self.check_result_auto("select c1, c2, c3 , c4, c5 from ct1",
"select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from ct1")
self.check_result_auto(
"select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from ct1;", "select c1 from ct1")
# used for stable table
tdSql.query("select abs(c1) from stb1")
tdSql.checkRows(25)
self.check_result_auto( "select c1, c2, c3 , c4, c5 from ct4 ", "select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from ct4")
self.check_result_auto("select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from ct4;" , "select c1 from ct4" )
self.check_result_auto("select c1, c2, c3 , c4, c5 from ct4 ",
"select (c1), abs(c2) ,abs(c3), abs(c4), abs(c5) from ct4")
self.check_result_auto(
"select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from ct4;", "select c1 from ct4")
# used for not exists table
tdSql.error("select abs(c1) from stbbb1")
@ -377,7 +378,6 @@ class TDTestCase:
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
# bug fix for count
tdSql.query("select count(c1) from ct4 ")
tdSql.checkData(0, 0, 9)
@ -405,11 +405,10 @@ class TDTestCase:
tdSql.checkData(1, 1, 8.000000000)
tdSql.checkData(1, 2, 7.900000000)
def abs_func_filter(self):
tdSql.execute("use db")
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1>5 ")
tdSql.query(
"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1>5 ")
tdSql.checkRows(3)
tdSql.checkData(0, 0, 8)
tdSql.checkData(0, 1, 8.000000000)
@ -417,7 +416,8 @@ class TDTestCase:
tdSql.checkData(0, 3, 7.900000000)
tdSql.checkData(0, 4, 3.000000000)
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1=5 ")
tdSql.query(
"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1=5 ")
tdSql.checkRows(1)
tdSql.checkData(0, 0, 5)
tdSql.checkData(0, 1, 5.000000000)
@ -425,7 +425,8 @@ class TDTestCase:
tdSql.checkData(0, 3, 4.900000000)
tdSql.checkData(0, 4, 2.000000000)
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1=5 ")
tdSql.query(
"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1=5 ")
tdSql.checkRows(1)
tdSql.checkData(0, 0, 5)
tdSql.checkData(0, 1, 5.000000000)
@ -433,7 +434,8 @@ class TDTestCase:
tdSql.checkData(0, 3, 4.900000000)
tdSql.checkData(0, 4, 2.000000000)
tdSql.query("select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1>log(c1,2) limit 1 ")
tdSql.query(
"select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(log(c1,2)-0.5) from ct4 where c1>log(c1,2) limit 1 ")
tdSql.checkRows(1)
tdSql.checkData(0, 0, 8)
tdSql.checkData(0, 1, 88888)
@ -442,7 +444,6 @@ class TDTestCase:
tdSql.checkData(0, 4, 7.900000000)
tdSql.checkData(0, 5, 3.000000000)
def abs_Arithmetic(self):
pass
@ -471,12 +472,16 @@ class TDTestCase:
tdSql.error(
f"insert into sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
self.check_result_auto( "select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ", "select abs(c1), abs(c2) ,abs(c3), abs(c4), abs(c5) ,abs(c6) from sub1_bound")
self.check_result_auto( "select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ", "select abs(c1), abs(c2) ,abs(c3), abs(c3), abs(c2) ,abs(c1) from sub1_bound")
self.check_result_auto("select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from sub1_bound;" , "select abs(c1) from sub1_bound" )
self.check_result_auto("select c1, c2, c3 , c4, c5 ,c6 from sub1_bound ",
"select abs(c1), abs(c2) ,abs(c3), abs(c4), abs(c5) ,abs(c6) from sub1_bound")
self.check_result_auto("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ",
"select abs(c1), abs(c2) ,abs(c3), abs(c3), abs(c2) ,abs(c1) from sub1_bound")
self.check_result_auto(
"select abs(abs(abs(abs(abs(abs(abs(abs(abs(abs(c1)))))))))) nest_col_func from sub1_bound;", "select abs(c1) from sub1_bound")
# check basic elem for table per row
tdSql.query("select abs(c1) ,abs(c2) , abs(c3) , abs(c4), abs(c5), abs(c6) from sub1_bound ")
tdSql.query(
"select abs(c1) ,abs(c2) , abs(c3) , abs(c4), abs(c5), abs(c6) from sub1_bound ")
tdSql.checkData(0, 0, 2147483647)
tdSql.checkData(0, 1, 9223372036854775807)
tdSql.checkData(0, 2, 32767)
@ -497,30 +502,36 @@ class TDTestCase:
tdSql.checkData(3, 5, 169999999999999993883079578865998174333346074304075874502773119193537729178160565864330091787584707988572262467983188919169916105593357174268369962062473635296474636515660464935663040684957844303524367815028553272712298986386310828644513212353921123253311675499856875650512437415429217994623324794855339589632.000000000)
# check + - * / in functions
tdSql.query("select abs(c1+1) ,abs(c2) , abs(c3*1) , abs(c4/2), abs(c5)/2, abs(c6) from sub1_bound ")
tdSql.query(
"select abs(c1+1) ,abs(c2) , abs(c3*1) , abs(c4/2), abs(c5)/2, abs(c6) from sub1_bound ")
tdSql.checkData(0, 0, 2147483648.000000000)
tdSql.checkData(0, 1, 9223372036854775807)
tdSql.checkData(0, 2, 32767.000000000)
tdSql.checkData(0, 3, 63.500000000)
tdSql.checkData(0,4,169999997607218212453866206899682148352.000000000)
tdSql.checkData(
0, 4, 169999997607218212453866206899682148352.000000000)
tdSql.checkData(0, 5, 169999999999999993883079578865998174333346074304075874502773119193537729178160565864330091787584707988572262467983188919169916105593357174268369962062473635296474636515660464935663040684957844303524367815028553272712298986386310828644513212353921123253311675499856875650512437415429217994623324794855339589632.000000000)
tdSql.checkData(1, 0, 2147483646.000000000)
tdSql.checkData(1, 1, 9223372036854775808.000000000)
tdSql.checkData(1, 2, 32767.000000000)
tdSql.checkData(1, 3, 63.500000000)
tdSql.checkData(1,4,169999997607218212453866206899682148352.000000000)
tdSql.checkData(
1, 4, 169999997607218212453866206899682148352.000000000)
self.check_result_auto("select c1+1 ,c2 , c3*1 , c4/2, c5/2, c6 from sub1_bound" ,"select abs(c1+1) ,abs(c2) , abs(c3*1) , abs(c4/2), abs(c5)/2, abs(c6) from sub1_bound ")
self.check_result_auto("select c1+1 ,c2 , c3*1 , c4/2, c5/2, c6 from sub1_bound",
"select abs(c1+1) ,abs(c2) , abs(c3*1) , abs(c4/2), abs(c5)/2, abs(c6) from sub1_bound ")
def test_tag_compute_for_scalar_function(self):
tdSql.execute("use testdb")
self.check_result_auto( "select c1, t2, t3 , t4, t5 from ct4 ", "select (c1), abs(t2) ,abs(t3), abs(t4), abs(t5) from ct4")
self.check_result_auto( "select c1+2, t2+2, t3 , t4, t5 from ct4 ", "select (c1)+2, abs(t2)+2 ,abs(t3), abs(t4), abs(t5) from ct4")
self.check_result_auto( "select c1+2, t2+2, t3 , t4, t5 from stb1 order by t1 ", "select (c1)+2, abs(t2)+2 ,abs(t3), abs(t4), abs(t5) from stb1 order by t1")
self.check_result_auto("select c1, t2, t3 , t4, t5 from ct4 ",
"select (c1), abs(t2) ,abs(t3), abs(t4), abs(t5) from ct4")
self.check_result_auto("select c1+2, t2+2, t3 , t4, t5 from ct4 ",
"select (c1)+2, abs(t2)+2 ,abs(t3), abs(t4), abs(t5) from ct4")
self.check_result_auto("select c1+2, t2+2, t3 , t4, t5 from stb1 order by t1 ",
"select (c1)+2, abs(t2)+2 ,abs(t3), abs(t4), abs(t5) from stb1 order by t1")
# bug need fix
@ -532,7 +543,7 @@ class TDTestCase:
# tdSql.query("select sum(t1) from (select c1 ,t1 from stb1)")
# tdSql.checkData(0,0,61)
# tdSql.query("select distinct(c1) ,t1 from stb1")
# tdSql.checkRows(11)
# tdSql.checkRows(20)
# tdSql.query("select max(t2) , t1 ,c1, t2 from stb1")
# tdSql.checkData(0,3,33333)
@ -543,9 +554,8 @@ class TDTestCase:
tdSql.checkRows(1)
# tdSql.query("select t1 from stb1 where abs(t1+c1)=1")
# tdSql.checkRows(1)
tdSql.query("select abs(c1+t1)*t1 from stb1 where abs(c1)/floor(abs(ceil(t1))) ==1")
tdSql.query(
"select abs(c1+t1)*t1 from stb1 where abs(c1)/floor(abs(ceil(t1))) ==1")
def run(self): # sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql.prepare()
@ -579,9 +589,14 @@ class TDTestCase:
self.test_tag_compute_for_scalar_function()
tdLog.printNoPrefix("==========step7: check result of query ============")
self.insert_datas_and_check_abs(self.tb_nums,self.row_nums,self.time_step)
def stop(self):
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())