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

   consider sql with user defined var @t_zone
   ```
   set @t_zone='GMT';
   SELECT 
       DATE_FORMAT(convert_tz(dt, time_zone, @t_zone),'%Y-%m-%d') day
   FROM 
       t
   GROUP BY 
       1;
   ```
   @tzone must be replaced as 'GMT' before EliminateGroupByConstant and 
NormalizeAggregate rule. So this pr move ReplaceVariableByLiteral rule from 
rewrite phase to analyze phase and put it before the two rules to make it work.
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## 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