Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](datetime) fix datetime round on BE (apache#31205) (apache#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 apache#30744 but implemented on BE
- Loading branch information