morningman opened a new issue #4494:
URL: https://github.com/apache/incubator-doris/issues/4494
**Describe the bug**
On FE, `str_to_date()` is implemented by `joda.DateTimeFormatter`,
and on BE, it is implemented by Doris it self.
These 2 implementations are inconsistent in some cases:
1. FE can not to the constant folding for `str_to_date("2020-08-08",
"%Y-%m-%d %H:%i:%s")`
It falls to BE and return `2020-08-08`, but in mysql, it returns
`2020-08-08 00:00:00`.
2. `select str_to_date("20-09-01", "%Y-%m-%d");`
FE return `0020-09-01`, but BE return `2020-09-01`, which is same as
MySQL.
3. Some BI will generate predicate like
`DATE_ADD(DATE_ADD(str_to_date(DATE_FORMAT(NOW(),'%Y-%m-%d'),'%Y-%m-%d
%H:%i:%s'),INTERVAL 1 DAY),INTERVAL -1 SECOND)`
It should be able to do the constant folding, but failed on
`str_to_date`.
**Resolution**
We should keep the behavior on BE and FE consistency.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]