-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](nereids) fix distinct window compute wrong result #48987
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 32649 ms |
TPC-DS: Total hot run time: 184344 ms |
ClickBench: Total hot run time: 31.73 s |
85708a8 to
be6aeb6
Compare
|
run buildall |
TPC-H: Total hot run time: 32423 ms |
TPC-DS: Total hot run time: 192680 ms |
ClickBench: Total hot run time: 31.36 s |
|
run buildall |
|
run buildall |
fix distinct window compute wrong result, introduced by apache#14397 ```sql select distinct sum(value) over(partition by id) from ( select 100 value, 1 id union all select 100, 2 )a; +----------------------------------+ | sum(value) over(partition by id) | +----------------------------------+ | 100 | | 100 | +----------------------------------+ ```
fix distinct window compute wrong result, introduced by apache#14397 ```sql select distinct sum(value) over(partition by id) from ( select 100 value, 1 id union all select 100, 2 )a; +----------------------------------+ | sum(value) over(partition by id) | +----------------------------------+ | 100 | | 100 | +----------------------------------+ ```
TPC-H: Total hot run time: 32408 ms |
TPC-DS: Total hot run time: 191602 ms |
ClickBench: Total hot run time: 31.25 s |
|
run buildall |
TPC-H: Total hot run time: 32274 ms |
|
run buildall |
fix distinct window compute wrong result, introduced by apache#14397 ```sql select distinct sum(value) over(partition by id) from ( select 100 value, 1 id union all select 100, 2 )a; +----------------------------------+ | sum(value) over(partition by id) | +----------------------------------+ | 100 | | 100 | +----------------------------------+ ```
fix distinct window compute wrong result, introduced by apache#14397 ```sql select distinct sum(value) over(partition by id) from ( select 100 value, 1 id union all select 100, 2 )a; +----------------------------------+ | sum(value) over(partition by id) | +----------------------------------+ | 100 | | 100 | +----------------------------------+ ```
|
run buildall |
TPC-H: Total hot run time: 32064 ms |
fix distinct window compute wrong result, introduced by apache#14397 ```sql select distinct sum(value) over(partition by id) from ( select 100 value, 1 id union all select 100, 2 )a; +----------------------------------+ | sum(value) over(partition by id) | +----------------------------------+ | 100 | | 100 | +----------------------------------+ ```
|
run buildall |
TPC-H: Total hot run time: 32211 ms |
TPC-DS: Total hot run time: 185145 ms |
ClickBench: Total hot run time: 30.69 s |
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ProjectToGlobalAggregate.java
Show resolved
Hide resolved
| sql "select distinct sum(value) over(partition by id) from (select 100 value, 1 id union all select 100, 2)a" | ||
| result([[100L]]) | ||
| } | ||
|
|
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.
add more case to cover all if branch in rules, such as
- qualify with alias
- qualify with new window function
- qualify with window function which has exsited in project list
- having
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ProjectToGlobalAggregate.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ProjectToGlobalAggregate.java
Show resolved
Hide resolved
...re/src/main/java/org/apache/doris/nereids/rules/analysis/ReplaceExpressionByChildOutput.java
Show resolved
Hide resolved
…result (apache#48987) (apache#49010)" This reverts commit 7123bbf.
What problem does this PR solve?
fix distinct window compute wrong result, introduced by #14397
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)