Baymine opened a new issue, #65244:
URL: https://github.com/apache/doris/issues/65244

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   ### Description
   
   When a single GROUP BY contains more than one DISTINCT aggregate and any of 
them
   is `collect_list(distinct ...)` or `array_agg(distinct ...)`, planning fails 
with:
   
       errCode = 2, ... can't support multi distinct.
   
   `CheckMultiDistinct` rejects any distinct aggregate that does not implement
   `SupportMultiDistinct`, and `collect_list` / `array_agg` do not implement it.
   So queries like these cannot run:
   
       select g, collect_list(distinct a), collect_list(distinct b) from t 
group by g;
       select g, array_agg(distinct a), array_agg(distinct b) from t group by g;
   
   Other aggregates (count, sum, sum0, group_concat) already support this 
through
   the multi-distinct framework. `collect_list` and `array_agg` should too, via 
new
   `multi_distinct_collect_list` and `multi_distinct_array_agg` functions.
   
   ### Solution
   
   Add `multi_distinct_collect_list` / `multi_distinct_array_agg` and make
   `CollectList` / `ArrayAgg` implement `SupportMultiDistinct`, plugging into 
the
   existing multi-distinct rewrite (BE + FE).
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to