We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
create table t(id int, c1 int, c2 double, c3 string) properties('replication_num'='1');
support distinct in analytic functions: count, sum and avg
select c1, c2, avg( distinct c1) over(partition by c2) from t;
doris/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
Lines 2140 to 2145 in 5435762
Lines 2155 to 2160 in 5435762
ExtractAndNormalizeWindowExpression
count(distinct c1) over(partition c2)
multi_distinct_count(c1) over(partition c2)
sum(distinct c1) over(partition c2)
multi_distinct_sum(c1) over(partition c2)
avg(distinct c1) over(partition c2)
cast(multi_distinct_sum(c1) over(partition c2) as double) / cast(multi_distinct_count(c1) over(partition c2) as double)
The text was updated successfully, but these errors were encountered:
I want to try 2.1
Sorry, something went wrong.
@cjj2010 This issue cannot be split into smaller tasks for solving. Can you handle the entire issue?
Okay, I am willing to handle the entire issue. The business scenario I am currently facing requires this feature very much
@cjj2010 Great! I will assign this issue to you
cjj2010
No branches or pull requests
Search before asking
Description
support distinct in analytic functions: count, sum and avg
Solution
1.1.
doris/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
Lines 2140 to 2145 in 5435762
1.2.
doris/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
Lines 2155 to 2160 in 5435762
ExtractAndNormalizeWindowExpression
2.1.
count(distinct c1) over(partition c2)
tomulti_distinct_count(c1) over(partition c2)
2.2.
sum(distinct c1) over(partition c2)
tomulti_distinct_sum(c1) over(partition c2)
2.3.
avg(distinct c1) over(partition c2)
tocast(multi_distinct_sum(c1) over(partition c2) as double) / cast(multi_distinct_count(c1) over(partition c2) as double)
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: