fix: the field is not float or double match invalid tsz compress
This commit is contained in:
parent
a247a43863
commit
65d724c178
|
@ -47,14 +47,20 @@ class TDTestCase(TBase):
|
||||||
dtypes = [ "tinyint","tinyint unsigned","smallint","smallint unsigned","int","int unsigned",
|
dtypes = [ "tinyint","tinyint unsigned","smallint","smallint unsigned","int","int unsigned",
|
||||||
"bigint","bigint unsigned","timestamp","bool","float","double","binary(16)","nchar(16)",
|
"bigint","bigint unsigned","timestamp","bool","float","double","binary(16)","nchar(16)",
|
||||||
"varchar(16)","varbinary(16)"]
|
"varchar(16)","varbinary(16)"]
|
||||||
|
|
||||||
|
def combineValid(self, datatype, encode, compress):
|
||||||
|
if datatype != "float" and datatype != "double":
|
||||||
|
if compress == "tsz":
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def genAllSqls(self, stbName, max):
|
def genAllSqls(self, stbName, max):
|
||||||
# encode
|
# encode
|
||||||
encodes = [
|
encodes = [
|
||||||
[["tinyint","tinyint unsigned","smallint","smallint unsigned","int","int unsigned","bigint","bigint unsigned"], ["simple8b"]],
|
[["tinyint","tinyint unsigned","smallint","smallint unsigned","int","int unsigned","bigint","bigint unsigned"], ["simple8B"]],
|
||||||
[["timestamp","bigint","bigint unsigned"], ["delta-i"]],
|
[["timestamp","bigint","bigint unsigned"], ["Delta-i"]],
|
||||||
[["bool"], ["bit-packing"]],
|
[["bool"], ["Bit-packing"]],
|
||||||
[["float","double"], ["delta-d"]]
|
[["float","double"], ["Delta-d"]]
|
||||||
]
|
]
|
||||||
|
|
||||||
c = 0 # column number
|
c = 0 # column number
|
||||||
|
@ -65,7 +71,6 @@ class TDTestCase(TBase):
|
||||||
|
|
||||||
# loop append sqls
|
# loop append sqls
|
||||||
for lines in encodes:
|
for lines in encodes:
|
||||||
print(lines)
|
|
||||||
for datatype in lines[0]:
|
for datatype in lines[0]:
|
||||||
for encode in lines[1]:
|
for encode in lines[1]:
|
||||||
for compress in self.compresses:
|
for compress in self.compresses:
|
||||||
|
@ -74,8 +79,9 @@ class TDTestCase(TBase):
|
||||||
# first
|
# first
|
||||||
sql = f"create table {self.db}.st{t} (ts timestamp"
|
sql = f"create table {self.db}.st{t} (ts timestamp"
|
||||||
else:
|
else:
|
||||||
sql += f", c{c} {datatype} ENCODE '{encode}' COMPRESS '{compress}' LEVEL '{level}'"
|
if self.combineValid(datatype, encode, compress):
|
||||||
c += 1
|
sql += f", c{c} {datatype} ENCODE '{encode}' COMPRESS '{compress}' LEVEL '{level}'"
|
||||||
|
c += 1
|
||||||
|
|
||||||
if c >= max:
|
if c >= max:
|
||||||
# append sqls
|
# append sqls
|
||||||
|
@ -97,9 +103,11 @@ class TDTestCase(TBase):
|
||||||
# check error create
|
# check error create
|
||||||
def errorCreate(self):
|
def errorCreate(self):
|
||||||
sqls = [
|
sqls = [
|
||||||
f"create table terr(ts timestamp, c0 int ENCODE 'abc') ",
|
f"create table terr(ts timestamp, c0 int ENCODE 'simple8B' COMPRESS 'tsz' LEVEL 'high') ",
|
||||||
f""
|
f"create table terr(ts timestamp, bi bigint encode 'bit-packing') tags (area int);"
|
||||||
|
f"create table terr(ts timestamp, ic int encode 'delta-d') tags (area int);"
|
||||||
]
|
]
|
||||||
|
tdSql.errors(sqls)
|
||||||
|
|
||||||
for dtype in self.dtypes:
|
for dtype in self.dtypes:
|
||||||
# encode
|
# encode
|
||||||
|
@ -111,6 +119,11 @@ class TDTestCase(TBase):
|
||||||
# level
|
# level
|
||||||
sql = f"create table terr(ts timestamp, c0 {dtype} LEVEL 'hig') "
|
sql = f"create table terr(ts timestamp, c0 {dtype} LEVEL 'hig') "
|
||||||
tdSql.error(sql)
|
tdSql.error(sql)
|
||||||
|
|
||||||
|
# tsz check
|
||||||
|
if dtype != "float" and dtype != "double":
|
||||||
|
sql = f"create table terr(ts timestamp, c0 {dtype} COMPRESS 'tsz') "
|
||||||
|
tdSql.error(sql)
|
||||||
|
|
||||||
# default value correct
|
# default value correct
|
||||||
def defaultCorrect(self):
|
def defaultCorrect(self):
|
||||||
|
|
Loading…
Reference in New Issue