-
Notifications
You must be signed in to change notification settings - Fork 591
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
fix(over window): fix error in using aggregate function result as win… #12551
Changes from 7 commits
8ba0605
0d7caa6
fc9f48b
593706c
7cd9457
3b0645c
5e18a8a
4147b8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
statement ok | ||
create table t (a int, b int, c int, d int, e int); | ||
|
||
statement ok | ||
insert into t values | ||
(1, 23, 84, 11, 87), | ||
(2, 34, 29, 22, 98), | ||
(3, 45, 43, 33, 10), | ||
(4, 56, 83, 44, 26), | ||
(5, 68, 20, 55, 12), | ||
(5, 68, 90, 66, 34), | ||
(5, 68, 11, 77, 32); | ||
|
||
query II | ||
select | ||
a, | ||
sum((sum(b))) over (partition by a order by a) | ||
from t | ||
group by a; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is for consistent result, should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Should be added to every query in this file. |
||
---- | ||
1 23 | ||
2 34 | ||
3 45 | ||
4 56 | ||
5 204 | ||
|
||
query II | ||
select | ||
a, | ||
row_number() over (partition by a order by a) | ||
from t | ||
group by a; | ||
---- | ||
1 1 | ||
2 1 | ||
3 1 | ||
4 1 | ||
5 1 | ||
|
||
query II | ||
select | ||
a, | ||
row_number() over (partition by a order by a desc) | ||
from t | ||
group by a; | ||
---- | ||
1 1 | ||
2 1 | ||
3 1 | ||
4 1 | ||
5 1 | ||
|
||
query III | ||
select | ||
a, | ||
b, | ||
sum(sum(c)) over (partition by a order by b) | ||
from t | ||
group by a, b; | ||
---- | ||
1 23 84 | ||
2 34 29 | ||
3 45 43 | ||
4 56 83 | ||
5 68 121 | ||
|
||
query III | ||
select | ||
a, | ||
b, | ||
sum(sum(c)) over (partition by a, avg(d) order by max(e), b) | ||
from t | ||
group by a, b; | ||
---- | ||
1 23 84 | ||
2 34 29 | ||
3 45 43 | ||
4 56 83 | ||
5 68 121 | ||
|
||
statement ok | ||
drop table t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you plz test some cases like the following where
partition by
andorder by
are not the same asgroup by
?Or, if we want to go further:
Also plz add streaming version of these tests. You may refer to how OverWindow is e2e-tested.