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

feat(stream): implement HopWindowExecutor #1718

Merged
merged 11 commits into from
Apr 12, 2022
Merged

feat(stream): implement HopWindowExecutor #1718

merged 11 commits into from
Apr 12, 2022

Conversation

TennyZhuang
Copy link
Contributor

@TennyZhuang TennyZhuang commented Apr 8, 2022

What's changed and what's your intention?

PLEASE DO NOT LEAVE THIS EMPTY !!!

Implement hop window in backend.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

Signed-off-by: TennyZhuang <[email protected]>
@codecov
Copy link

codecov bot commented Apr 8, 2022

Codecov Report

Merging #1718 (0784414) into main (fc93222) will increase coverage by 0.21%.
The diff coverage is 86.68%.

@@            Coverage Diff             @@
##             main    #1718      +/-   ##
==========================================
+ Coverage   71.12%   71.33%   +0.21%     
==========================================
  Files         603      605       +2     
  Lines       78066    78553     +487     
==========================================
+ Hits        55524    56037     +513     
+ Misses      22542    22516      -26     
Flag Coverage Δ
rust 71.33% <86.68%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/stream/src/executor_v2/error.rs 0.00% <ø> (ø)
src/stream/src/lib.rs 100.00% <ø> (ø)
src/stream/src/executor_v2/hop_window.rs 82.50% <82.50%> (ø)
src/stream/src/executor_v2/mod.rs 61.22% <83.33%> (+5.41%) ⬆️
src/common/src/types/interval.rs 78.37% <95.08%> (+21.23%) ⬆️
src/common/src/array/stream_chunk.rs 90.27% <100.00%> (+0.99%) ⬆️
src/expr/src/expr/mod.rs 48.78% <100.00%> (+8.78%) ⬆️
src/stream/src/executor/top_n_appendonly.rs 0.00% <0.00%> (-84.54%) ⬇️
src/meta/src/manager/stream_clients.rs 88.88% <0.00%> (-7.41%) ⬇️
src/stream/src/executor/test_utils.rs 70.63% <0.00%> (-6.35%) ⬇️
... and 27 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2022

CLA assistant check
All committers have signed the CLA.

@TennyZhuang TennyZhuang requested a review from BugenZhao April 11, 2022 18:17
@TennyZhuang TennyZhuang marked this pull request as ready for review April 11, 2022 18:17
@TennyZhuang
Copy link
Contributor Author

Ready for review!

Signed-off-by: TennyZhuang <[email protected]>
Copy link
Member

@fuyufjh fuyufjh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

('-', 5, 3, t(10, 33)),
('+', 6, 2, t(10, 42)),
('-', 7, 1, t(10, 51)),
('+', 8, 3, t(11, 02)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's coooool! Hope others can also write their tests within this style

StreamExecutorError::InvalidArgument(format!(
"window_size {} cannot be divided by window_slide {}",
window_size, self.window_slide
))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to do this check in frontend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But frontend don't need the result..

let window_start_offset =
self.window_slide.checked_mul_int(i).ok_or_else(|| {
StreamExecutorError::InvalidArgument(format!(
"window_slide {} cannot be multiplied by {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious... How can this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure :(

Copy link
Contributor Author

@TennyZhuang TennyZhuang Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IntervalUnit can only represent months in i32,if the month is too big or the units are too big, it will happen (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same to days

Signed-off-by: TennyZhuang <[email protected]>
@TennyZhuang TennyZhuang merged commit d0a2928 into main Apr 12, 2022
@TennyZhuang TennyZhuang deleted the feat/hop-window branch April 12, 2022 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants