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

there is something wrong with AggregateFunction count #294

Closed
worldmaomao opened this issue Jun 8, 2020 · 2 comments · Fixed by #296
Closed

there is something wrong with AggregateFunction count #294

worldmaomao opened this issue Jun 8, 2020 · 2 comments · Fixed by #296
Assignees

Comments

@worldmaomao
Copy link

Here is the data query every 10s:
sql:
SELECT * FROM events where meta(device)="TestModbusDevice" and (Coil_150 !=null or Coil_100 != null) GROUP BY TUMBLINGWINDOW(ss, 10)

query data:
[{"Coil_150":true},{"Coil_100":true}]
[{"Coil_150":true},{"Coil_100":true}]
[{"Coil_150":true},{"Coil_100":true}]
[{"Coil_150":true},{"Coil_100":true}]
[{"Coil_150":true},{"Coil_100":true}]
[{"Coil_150":true},{"Coil_100":true}]

Now I want to calculate the total count for different element in every 10s.
Here is my sql:

SELECT count(Coil_150) as a, count(Coil_100) as b FROM events where meta(device)="TestModbusDevice" and (Coil_150 !=null or Coil_100 != null) GROUP BY TUMBLINGWINDOW(ss, 10)

the actual result:
[{"a":2,"b":2}]
[{"a":2,"b":2}]
[{"a":2,"b":2}]
[{"a":2,"b":2}]
[{"a":2,"b":2}]

the expect result:
[{"a":1,"b":1}]
[{"a":1,"b":1}]
[{"a":1,"b":1}]
[{"a":1,"b":1}]
[{"a":1,"b":1}]

So it is something wrong with my sql or it is bug ?
my kuiper version is 0.4.1
Thank you!

@worldmaomao
Copy link
Author

you are a super man!

@ngjaying
Copy link
Collaborator

ngjaying commented Jun 8, 2020

you are a super man!

Laugh. Thanks for the very clear description, it helps us to identify the problem much faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants