What can know that my stream table is done while using tdengine’s continuous query?

16 Views Asked by At

I followed TDengine’s website about continuous query. And I used the follow command to create a table to store the continuous query result.

create table if not exists tmp as select count(*) from test interval(1m) sliding (30s);

After execute upper sql clause, i query data from “tmp”, which is an empty table. But after a while I queried from “tmp” once again,I got data. I want to ask how long should I wait to confirm that the “tmp” will have data be stored?

1

There are 1 best solutions below

0
xiaolei On

Actualy, it will take at least interval time (in your example 1 min) the retrieved data will be write into "tmp". In order to confirm that the write operation has down, you can use the follow command:

show streams;

to check your stream IF EXEC TIME IS NULL means you continuous query havn't done, conversly if exec_time is not null which means your continuous query is done and you can query "tmp" now.