feat: event window query
This commit is contained in:
parent
363070b723
commit
99d997012a
|
@ -136,7 +136,7 @@ class TDTestCase:
|
||||||
tdSql.query("use source_db")
|
tdSql.query("use source_db")
|
||||||
tdSql.query("create table if not exists source_db.stb (ts timestamp, k int) tags (a int);")
|
tdSql.query("create table if not exists source_db.stb (ts timestamp, k int) tags (a int);")
|
||||||
tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);")
|
tdSql.query("create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);")
|
||||||
tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS start, min(k), max(k), sum(k) from source_db.stb interval(10m);")
|
tdSql.query("create stream s1 into source_db.output_stb as select _wstart AS startts, min(k), max(k), sum(k) from source_db.stb interval(10m);")
|
||||||
|
|
||||||
|
|
||||||
#TD-19944 -Q=3
|
#TD-19944 -Q=3
|
||||||
|
|
|
@ -108,7 +108,7 @@ class TDTestCase:
|
||||||
|
|
||||||
|
|
||||||
# create stream
|
# create stream
|
||||||
tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
|
tdSql.execute('''create stream current_stream into stream_max_stable_1 as select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s);''')
|
||||||
|
|
||||||
# insert data
|
# insert data
|
||||||
for i in range(num_random*n):
|
for i in range(num_random*n):
|
||||||
|
@ -187,20 +187,20 @@ class TDTestCase:
|
||||||
|
|
||||||
sleep(5)
|
sleep(5)
|
||||||
# stream data check
|
# stream data check
|
||||||
tdSql.query("select start,wend,max_int from stream_max_stable_1 ;")
|
tdSql.query("select startts,wend,max_int from stream_max_stable_1 ;")
|
||||||
tdSql.checkRows(20)
|
tdSql.checkRows(20)
|
||||||
tdSql.query("select sum(max_int) from stream_max_stable_1 ;")
|
tdSql.query("select sum(max_int) from stream_max_stable_1 ;")
|
||||||
stream_data_1 = tdSql.queryResult[0][0]
|
stream_data_1 = tdSql.queryResult[0][0]
|
||||||
tdSql.query("select sum(min_int) from stream_max_stable_1 ;")
|
tdSql.query("select sum(min_int) from stream_max_stable_1 ;")
|
||||||
stream_data_2 = tdSql.queryResult[0][0]
|
stream_data_2 = tdSql.queryResult[0][0]
|
||||||
tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));")
|
tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 where ts is not null interval (5s));")
|
||||||
sql_data_1 = tdSql.queryResult[0][0]
|
sql_data_1 = tdSql.queryResult[0][0]
|
||||||
sql_data_2 = tdSql.queryResult[0][1]
|
sql_data_2 = tdSql.queryResult[0][1]
|
||||||
|
|
||||||
self.stream_value_check(stream_data_1,sql_data_1)
|
self.stream_value_check(stream_data_1,sql_data_1)
|
||||||
self.stream_value_check(stream_data_2,sql_data_2)
|
self.stream_value_check(stream_data_2,sql_data_2)
|
||||||
|
|
||||||
tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as start, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));")
|
tdSql.query("select sum(max_int),sum(min_int) from (select _wstart as startts, _wend as wend, max(q_int) as max_int, min(q_bigint) as min_int from stable_1 interval (5s));")
|
||||||
sql_data_1 = tdSql.queryResult[0][0]
|
sql_data_1 = tdSql.queryResult[0][0]
|
||||||
sql_data_2 = tdSql.queryResult[0][1]
|
sql_data_2 = tdSql.queryResult[0][1]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue