-
Notifications
You must be signed in to change notification settings - Fork 640
feat(watermark): topNExec state cleaning #8106
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
Comments
Operators generally access storage through |
May I ask about the use cases for ordering by the watermark (usually time) column in ascending manner? 🤔 |
I'm not sure about the exact use case. But it is possible for users to write such queries. cc @TennyZhuang @fuyufjh @st1page |
Emmm... I can not think up any use case for now. Let's remain this issue and see if it is required. |
Iet's wait to see the use case before decide a general interface. |
Let's wait some real-world requeriment about the topN's cleaning |
Plain top-n:
Ascending
We need to range delete records above the watermark, while currently, we can only delete those below the watermark.
Descending
This is more tricky. When watermark
w
arrives, we need to locate the smallest record with the first column value larger thanw
as then-th
records. We can clean all records with the watermark column smaller than the watermark value of(n+offset+limit)-th
records.In this case, two functions from the storage layer might be needed,
x
, return the position.pos
Group top-n:
For group topn with group key
a
, order byb
, to clean the state, range delete forb
is needed. (currently we can only range delete with a give watermark in the first column)The text was updated successfully, but these errors were encountered: