Skip to content

Commit

Permalink
fix(executor, frontend): BatchHopWindow executor should derive wind…
Browse files Browse the repository at this point in the history
…ow expr in frontend (#8403)

Co-authored-by: jon-chuang <jon-chuang@users.noreply.github.com>
  • Loading branch information
jon-chuang and jon-chuang authored Mar 8, 2023
1 parent 03df818 commit e6f2561
Show file tree
Hide file tree
Showing 7 changed files with 382 additions and 150 deletions.
29 changes: 28 additions & 1 deletion dashboard/proto/gen/batch_plan.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions e2e_test/batch/basic/time_window_utc.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,33 @@ group by window_start, uid order by window_start, uid;
3 8 2022-01-01 10:45:00+00:00
3 8 2022-01-01 11:00:00+00:00

statement ok
insert into t1 values
(9, 1, 4, '2022-01-02 10:00:00Z'),
(10, 3, 3, '2022-01-03 10:05:00Z'),
(11, 2, 2, '2022-01-04 10:14:00Z'),
(12, 1, 1, '2022-01-05 10:22:00Z');

query IIT
select uid, sum(v), window_start
from hop(t1, created_at, interval '1' day, interval '2' day)
group by window_start, uid order by window_start, uid;
----
1 11 2021-12-31 00:00:00+00:00
2 9 2021-12-31 00:00:00+00:00
3 16 2021-12-31 00:00:00+00:00
1 15 2022-01-01 00:00:00+00:00
2 9 2022-01-01 00:00:00+00:00
3 16 2022-01-01 00:00:00+00:00
1 4 2022-01-02 00:00:00+00:00
3 3 2022-01-02 00:00:00+00:00
2 2 2022-01-03 00:00:00+00:00
3 3 2022-01-03 00:00:00+00:00
1 1 2022-01-04 00:00:00+00:00
2 2 2022-01-04 00:00:00+00:00
1 1 2022-01-05 00:00:00+00:00


statement error
select * from hop(t1, created_at, interval '0', interval '1');

Expand Down
2 changes: 2 additions & 0 deletions proto/batch_plan.proto
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ message HopWindowNode {
data.IntervalUnit window_slide = 2;
data.IntervalUnit window_size = 3;
repeated uint32 output_indices = 4;
repeated expr.ExprNode window_start_exprs = 5;
repeated expr.ExprNode window_end_exprs = 6;
}

message TableFunctionNode {
Expand Down
Loading

0 comments on commit e6f2561

Please sign in to comment.