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

   ## Proposed changes
   
   Issue Number: close #xxx
   
   Java doesn't support the calculation of `0000-01-01`(0000 year is 1 B.C. 
which ISO-8601 defines). so some of our calc was wrong in FE. now fixed them.
   
   new result:
   ```sql
   mysql> select week('0000-01-01', 0),week('0000-01-01', 1),week('0000-01-01', 
2),week('0000-01-01', 3),week('0000-01-01', 4), week('0000-01-01', 5), 
week('0000-01-01', 6), week('0000-01-01', 7);
   +------+------+------+------+------+------+------+------+
   | 1    | 0    | 1    | 52   | 1    | 0    | 1    | 52   |
   +------+------+------+------+------+------+------+------+
   |    1 |    0 |    1 |   52 |    1 |    0 |    1 |   52 |
   +------+------+------+------+------+------+------+------+
   1 row in set (0.10 sec)
   
   mysql> select week('0000-01-02', 0),week('0000-01-02', 1),week('0000-01-02', 
2),week('0000-01-02', 3),week('0000-01-02', 4), week('0000-01-02', 5), 
week('0000-01-02', 6), week('0000-01-02
   +------+------+------+------+------+------+------+------+
   | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    |
   +------+------+------+------+------+------+------+------+
   |    1 |    1 |    1 |    1 |    1 |    1 |    1 |    1 |
   +------+------+------+------+------+------+------+------+
   1 row in set (0.10 sec)
   ```
   same with `yearweek`


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to