LiBinfeng-01 opened a new pull request, #33598:
URL: https://github.com/apache/doris/pull/33598

   ## Proposed changes
   
   Change argument 'case when' or 'if' inside aggregate function , to aggregate 
function(filter)
   example:
   select sum(case when t1.c1 = 101 then 1 END) from t1;
   ==>
   select sum(1) from t1 where t1.c1 = 101;
   note :
   - only If expression is needed to process cause CaseWhenToIf have already 
changed case when to if
     but in sql we can still see case when so case when is reserved to explain 
this rule
   - we can only have one aggregate function cause of filter would influence 
other aggregate function
   - we can only have case when/if function without else cause of then can only 
have one branch of choice
   - we can only have one case in case when cause of then can only have one 
branch of choice
   
   


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