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

   ## Proposed changes
   
   [Issue Number: close #xxx](https://github.com/apache/doris/issues/30229)
   
   Error Reason:
   In the expression, time_to_sec(timediff('2024-01-22', '2024-01-15')), the 
two strings '2024-01-22' and '2024-01-15' are first cast to datetime types. Due 
to the absence of the timev2 type in the input parameters of the new optimizer 
for the time_to_sec function, it falls back to the old optimizer. At this 
point, the signature of timediff is name = "timediff", argTypes = { "DATETIME", 
"DATETIME" }, returnType = "TIMEV2"). This signature triggers constant folding, 
but the constant folding mechanism is outdated and hasn't been updated in 
subsequent releases. As a result, an error occurs.
   
   In contrast, time_to_sec(timediff(to_date('2024-01-22'), 
to_date('2024-01-15'))), due to the presence of an additional function, does 
not trigger the constant folding error.
   
   <!--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