XieJiann opened a new pull request, #21626:
URL: https://github.com/apache/doris/pull/21626

   … multi_distinct will result in an error.
   
   ## Proposed changes
   
   This commit introduces a transformation for SQL queries that contain 
multiple distinct aggregate functions. When the number of distinct values 
processed by these functions is greater than 1, they are converted into 
multi_distinct functions for more efficient handling.
   
   Example:
   ```
   SELECT COUNT(DISTINCT c1), SUM(DISTINCT c2) FROM tbl GROUP BY c3
   -- Transformed to
   SELECT MULTI_DISTINCT_COUNT(c1), MULTI_DISTINCT_SUM(c2) FROM tbl GROUP BY c3
   ```
   
   The following functions can be transformed:
   - COUNT
   - SUM
   - AVG
   - GROUP_CONCAT
   
   If any unsupported functions are encountered, an error is now reported 
during the optimization phase.
   
   To ensure the absence of such cases, a final check has been implemented 
after the rewriting phase.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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