-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8ba0605
fix(over window): fix error in using aggregate function result as win…
jetjinser 0d7caa6
test: add planner_test agg with window function
jetjinser fc9f48b
test: add e2e_test agg with window function
jetjinser 593706c
test: add more complex agg with window e2e_test
jetjinser 7cd9457
test: fix the agg planner_test query missed agg
jetjinser 3b0645c
test: more complex agg with window planner_test
jetjinser 5e18a8a
test: add "over_window with agg" streaming e2e_test
jetjinser 4147b8c
test: add `group by` to every agg + window query
jetjinser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
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 | ||
order by a; | ||
---- | ||
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 | ||
order 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 | ||
order 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 | ||
order 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 | ||
order by a, b; | ||
---- | ||
1 23 84 | ||
2 34 29 | ||
3 45 43 | ||
4 56 83 | ||
5 68 121 | ||
|
||
statement ok | ||
drop table t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.