You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Version
0.15
What's Wrong?
# doris 0.15# timestampdiff between 1981-09-11 and 2022-04-28 should be 40 yearsSELECT
TIMESTAMPDIFF(YEAR,DATE('1981-09-11'),'2022-04-28') AS`date-str`,
TIMESTAMPDIFF(YEAR,'1981-09-11','2022-04-28') AS`str-str`,
TIMESTAMPDIFF(YEAR,DATE('1981-09-11'),DATE('2022-04-28')) AS`date-date`,
TIMESTAMPDIFF(YEAR,'1981-09-11',DATE('2022-04-28')) AS`str-date`# while the result is date-str str-str date-date str-date41404141# timestampdiff between 1981-04-11 and 2022-04-28 should be 41 yearsSELECT
TIMESTAMPDIFF(YEAR,DATE('1981-09-11'),'2022-04-28') AS`date-str`,
TIMESTAMPDIFF(YEAR,'1981-09-11','2022-04-28') AS`str-str`,
TIMESTAMPDIFF(YEAR,DATE('1981-04-11'),DATE('2022-04-28')) AS`date-date`,
TIMESTAMPDIFF(YEAR,'1981-04-11',DATE('2022-04-28')) AS`str-date`# while the result is date-str str-str date-date str-date41404141
What You Expected?
timestampdiff between 1981-09-11 and 2022-04-28 should be 40 year
timestampdiff between 1981-04-11 and 2022-04-28 should be 41 year
Anything Else?
This also happens when unit is MONTH !
And it even get different result using TIMESTAMP(expr) instead of DATE(expr)
Search before asking
Version
0.15
What's Wrong?
What You Expected?
timestampdiff between 1981-09-11 and 2022-04-28 should be 40 year
timestampdiff between 1981-04-11 and 2022-04-28 should be 41 year
Anything Else?
This also happens when
unit
isMONTH
!And it even get different result using
TIMESTAMP(expr)
instead ofDATE(expr)
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: