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

Support New Type of Window #2841

Open
sunjiawe opened this issue May 11, 2024 · 4 comments
Open

Support New Type of Window #2841

sunjiawe opened this issue May 11, 2024 · 4 comments
Labels
kind/feature New feature or request

Comments

@sunjiawe
Copy link

What would you like to be added/modified:

It is a good idea to add a new type of windows, not base on time or count, but on the condition expr.

TDengine have this feature: https://docs.tdengine.com/taos-sql/distinguished/#state-window
continuous rows with the same status belong to a status window. Once the status changes, the status window closes

Why is this needed:
It will be very helpful in some manufacturing applicatrion.

Maybe I'm a new player, can I implement this with the existing syntax?

@ngjaying
Copy link
Collaborator

@sunjiawe
Copy link
Author

Check the conditional sliding window https://ekuiper.org/docs/en/latest/sqls/windows.html#the-trigger-condition-of-the-sliding-window

how to exactly control the start point of the window?
refer: https://docs.tdengine.com/taos-sql/distinguished/#event-window
td can use start with expr1 end with expr2

conditional sliding window, in my understanding, only can control end with OVER(when expr)

@sunjiawe
Copy link
Author

Check the conditional sliding window https://ekuiper.org/docs/en/latest/sqls/windows.html#the-trigger-condition-of-the-sliding-window

this is the demo in https://docs.tdengine.com/taos-sql/distinguished/#event-window

select _wstart, _wend, count(*) from t event_window start with c1 > 0 end with c2 < 10 

And this is the version I translated into ekuiper:

SELECT count(*) FROM t GROUP BY SlidingWindow(ss,60) FILTER(where c1 > 0) OVER(when c2 < 10)

FILTER control the window started, OVER control the window closed. And (ss,60) is an additional constraint on the windows length on time. Am I right?

@sunjiawe
Copy link
Author

Snipaste_2024-05-11_09-18-16

I don't think conditional sliding window meet my need. The doc mean Each piece of data meets the filtering conditions will trigger.

I want only trigger once when OVER expr, then the windows should reopen on FILTER expr

@ngjaying ngjaying added the kind/feature New feature or request label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants