zhiqiang-hhhh opened a new pull request, #31229:
URL: https://github.com/apache/doris/pull/31229

   with tmp as (
               select CONCAT(
                   YEAR('2024-02-06 03:37:07.157'), '-', 
                   LPAD(MONTH('2024-02-06 03:37:07.157'), 2, '0'), '-',
                   LPAD(DAY('2024-02-06 03:37:07.157'), 2, '0'), ' ',
                   LPAD(HOUR('2024-02-06 03:37:07.157'), 2, '0'), ':',
                   LPAD(MINUTE('2024-02-06 03:37:07.157'), 2, '0'), ':',
                   LPAD(SECOND('2024-02-06 03:37:07.157'), 2, '0'), '.', 
"123456789" )
               AS generated_string)
               select generated_string, cast(generated_string as DateTime(6)) 
from tmp
   before (incorrect round)
   
   +-------------------------------+-----------------------------------------+
   | generated_string              | cast(generated_string as DATETIMEV2(6)) |
   +-------------------------------+-----------------------------------------+
   | 2024-02-06 03:37:07.123456789 | 2024-02-06 03:37:07.123456              |
   +-------------------------------+-----------------------------------------+
   after (round up, keep consistent with mysql):
   
   +-------------------------------+-----------------------------------------+
   | generated_string              | cast(generated_string as DATETIMEV2(6)) |
   +-------------------------------+-----------------------------------------+
   | 2024-02-06 03:37:07.123456789 | 2024-02-06 03:37:07.123457              |
   +-------------------------------+-----------------------------------------+
   1 row in set (0.03 sec)
   same work with #30744 but implemented on BE
   
   ## Proposed changes
   
   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