Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream does not generate data #518

Open
localvar opened this issue Mar 5, 2024 · 7 comments
Open

stream does not generate data #518

localvar opened this issue Mar 5, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@localvar
Copy link
Contributor

localvar commented Mar 5, 2024

Describe the bug(Bug 描述)

I create a stream but it does not generate any data.

To Reproduce(Bug 复现步骤)

  1. create database and measurement
> create database db0
> use db0
> insert cpu,host=server-01,region=east-cn disk=1i,memory=2i,network=3i
> insert cpu,host=server-02,region=east-cn disk=1i,memory=2i,network=3i
  1. create stream to count number of data in a 5 minutes interval
> create stream test into db0.autogen.cpu5m on select count(memory) from cpu group by time(5m)
> show streams
+----------+-----------+-------------+------+--------------------+------------+----------------------------+----------+-------+
| database | retention | measurement | Name | source measurement | dimensions |           calls            | interval | delay |
+----------+-----------+-------------+------+--------------------+------------+----------------------------+----------+-------+
| db0      | autogen   | cpu5m       | test | cpu.autogen.cpu    |            | count_memoryAScount_memory | 5m0s     | 0s    |
+----------+-----------+-------------+------+--------------------+------------+----------------------------+----------+-------+
9 columns, 1 rows in set
  1. insert some records into the original measurement
> insert cpu,host=server-01,region=south-cn disk=12i,memory=13i,network=14i
> insert cpu,host=server-01,region=south-cn disk=12i,memory=13i,network=14i
> insert cpu,host=server-01,region=south-cn disk=12i,memory=13i,network=14i
...
  1. wait 5+ minutes and then check the generated data
> select count(memory) from cpu group by time(5m) order by time desc limit 5
name: cpu
+----------------------+-------+
|         time         | count |
+----------------------+-------+
| 2024-03-05T02:05:00Z |     8 |
| 2024-03-05T02:00:00Z |     2 |
| 2024-03-05T01:55:00Z |     0 |
| 2024-03-05T01:50:00Z |     0 |
| 2024-03-05T01:45:00Z |     0 |
+----------------------+-------+
2 columns, 5 rows in set

> select * from cpu5m
>

Expected behavior(期望结果)

No response

Screenshots(屏幕截图)

No response

Logs(完整的错误日志)

No response

Additional context(其他的一些补充内容)

No response

@localvar localvar added the bug Something isn't working label Mar 5, 2024
@localvar
Copy link
Contributor Author

localvar commented Mar 5, 2024

BTW, there's a typo in the documentation

CREATE STREAM test INTO db0.autogen.cpu1 AS SELECT sum("usage_user") AS "sum_usage_user" FROM "telegraf"."autogen"."cpu" group by time(1m),"cpu","host" delay 20s

should be

CREATE STREAM test INTO db0.autogen.cpu1 ON SELECT sum("usage_user") AS "sum_usage_user" FROM "telegraf"."autogen"."cpu" group by time(1m),"cpu","host" delay 20s

@xiangyu5632
Copy link
Member

BTW, there's a typo in the documentation

CREATE STREAM test INTO db0.autogen.cpu1 AS SELECT sum("usage_user") AS "sum_usage_user" FROM "telegraf"."autogen"."cpu" group by time(1m),"cpu","host" delay 20s

should be

CREATE STREAM test INTO db0.autogen.cpu1 ON SELECT sum("usage_user") AS "sum_usage_user" FROM "telegraf"."autogen"."cpu" group by time(1m),"cpu","host" delay 20s

tkx @localvar

@xiangyu5632
Copy link
Member

@vicky-run Is there a problem with the stream function?

@vicky-run
Copy link
Member

image
I test this function ok。Are you using the latest version? Or can you add information about the deployment and version?

@localvar
Copy link
Contributor Author

localvar commented Mar 6, 2024

still not work in my side.
I built openGemini myself from the latest commit: eb39829.
I'm using ts-server in windows wsl2 (ubuntu 20.04).

@localvar
Copy link
Contributor Author

localvar commented Mar 7, 2024

I tried again in a 3 nodes cluster, it works. so seems this issue only exists in single node mode.
@vicky-run

@vicky-run
Copy link
Member

Thanks for your reminder. We will fix this in an upcoming version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants