tdSql.error("select %s( jtag->'location'='beijing') from jsons1 ;"%fn)
tdSql.error("select %s( jtag contains 'age') from jsons1 ;"%fn)
# Select_exprs is SQL function -Calculation function
# Select_exprs is SQL function -Calculation function
tdSql.error(" select diff(dataint) from jsons1 where jtag->'location'= 'beijing' or jtag->'location'= 'tianjing'or jtag contains 'num' or jtag->'age'=35 ;")
tdSql.error(" select diff(dataint) from jsons1 where jtag->'location'= 'beijing' or jtag->'location'= 'tianjing'or jtag contains 'num' or jtag->'age'=35 ;")
...
@@ -500,13 +547,21 @@ class TDTestCase:
...
@@ -500,13 +547,21 @@ class TDTestCase:
tdSql.query("select ts,round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select ts,round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.query("select round(dataint),round(datafloat),round(datadouble) from jsons7 where jtag contains 'tea';")
tdSql.error("select %s( jtag->'location'='beijing') from jsons1 ;"%fn)
tdSql.error("select %s( jtag contains 'age') from jsons1 ;"%fn)
#modify one same key and diffirent data type,include negative number of double
#modify one same key and diffirent data type,include negative number of double
tdSql.execute("insert into jsons7_4 using jsons7 tags('{\"nv\":null,\"tea\":123,\"tag\":123,\"tea\":false}') values (now+1s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_4 using jsons7 tags('{\"nv\":null,\"tea\":123,\"tag\":123,\"tea\":false}') values (now+1s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_5 using jsons7 tags('{\"nv\":null,\"tea\":\"app\",\"tag\":123,\"tea\":false}') values (now+2s,5,'true',4.01,2.2,'abc'); ")
tdSql.execute("insert into jsons7_5 using jsons7 tags('{\"nv\":null,\"tea\":\"app\",\"tag\":123,\"tea\":false}') values (now+2s,5,'true',4.01,2.2,'abc'); ")
tdSql.error("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111111111111111111111111111111111111111111111111111111111111111,\"tag\":123,\"tea\":false}') values (now+3s,5,'true',4.01,2.2,'123'); ")
tdSql.error("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111111111111111111111111111111111111111111111111111111111111111,\"tag\":123,\"tea\":false}') values (now+3s,5,'true',4.01,2.2,'123'); ")
tdSql.execute("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111,\"tag\":123,\"tea\":false}') values (now,5,'false',4.01,2.2,'t123'); ")
tdSql.execute("insert into jsons7_6 using jsons7 tags('{\"nv\":null,\"tea\":-1.111111111,\"tag\":123,\"tea\":false}') values (now,5,'false',4.01,2.2,'t123'); ")
tdSql.query("select jtag from jsons7 where jtag->'tea'>-1.01;")
tdSql.query("select jtag from jsons7 where jtag->'tea'<-1.01;")
# tdSql.checkRows(2)
tdSql.checkRows(1)
# test join
# test join
tdSql.execute("create table if not exists jsons6(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50)) tags(jtag json)")
tdSql.execute("create table if not exists jsons6(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50)) tags(jtag json)")
...
@@ -572,6 +627,28 @@ class TDTestCase:
...
@@ -572,6 +627,28 @@ class TDTestCase:
tdSql.query(" select stddev(dataint) from jsons8 group by datatime;")
tdSql.query(" select stddev(dataint) from jsons8 group by datatime;")
tdSql.error(" select stddev(datatime) from jsons8 group by datadouble;")
tdSql.error(" select stddev(datatime) from jsons8 group by datadouble;")
# #test import and export
# tdSql.execute("select * from jsons1 >> jsons1_data.csv;")