New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
week iso related function #20511
Comments
Hi,could you assign this task to me please? |
My idea is to implement the weekiso function, which requires taking Monday as the start of each week. Originally, I thought about implementing it simply by calling week_of_year_with_mode directly. However, this results in the following output for the weekiso function:
However, this does not seem to be compliant with ISO. Therefore, when the week_of_year_with_mode function is called with a date and a parameter of 1, we need to recalculate using the last day of the previous year as the parameter when the return value is 0. We should get 52 weeks for the previous year, and the output should be as follows:
Do you think this logic is feasible? @wangsimo0 |
Sounds great. Can you pull a request for your anlysis? |
Signed-off-by: qmengss <707549024@qq.com>
Signed-off-by: qmengss <707549024@qq.com>
Signed-off-by: qmengss <707549024@qq.com> Signed-off-by: qmengss <707549024@qq.com>
hi, this is my PR, #22773. |
${PREPEND:SIGNED-OFF-BY=qmengss<707549024@qq.com>}
${PREPEND:SIGNED-OFF-BY=qmengss<707549024@qq.com>} Signed-off-by: qmengss <707549024@qq.com>
…tarRocks#20511) Signed-off-by: qmengss <707549024@qq.com>
…e implementation logic. (StarRocks#20511) Signed-off-by: qmengss <707549024@qq.com>
Hi,I found that when calling week(datetime, mode) with mode set to 3, it conforms to the ISO week standard. So I simplified the logic by directly calling the underlying method of week with mode set to 3. This reduces the amount of code and achieves the same effect. |
…string case (StarRocks#20511) Signed-off-by: qmengss <707549024@qq.com>
…22773) Signed-off-by: qmengss <707549024@qq.com>
…22773) Signed-off-by: qmengss <707549024@qq.com>
…22773) Signed-off-by: Kevin Li <ming.moriarty@gmail.com>
…22773) Signed-off-by: qmengss <707549024@qq.com>
…22773) Signed-off-by: qmengss <707549024@qq.com>
…22773) Signed-off-by: qmengss <707549024@qq.com>
As mentioned in #15385, the
week
function in sr is not following ISO week.There are two week related function needs week_iso function:
The text was updated successfully, but these errors were encountered: