You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "jiamin13579 (via GitHub)" <gi...@apache.org> on 2024/04/25 03:56:30 UTC
[PR] [hot-fix] Fix the Chinese characters in the code to the number '1461' [amoro]
jiamin13579 opened a new pull request, #2784:
URL: https://github.com/apache/amoro/pull/2784
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://amoro.apache.org/how-to-contribute/
2. If the PR is related to an issue in https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title, e.g., '[AMORO-XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][AMORO-XXXX] Your PR title ...'.
-->
## Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about its use case.
2. If you fix a bug, you can clarify why it is a bug.
3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
-->
In this code snippet, "1461" represents a specific numerical value, which actually denotes the total number of days in four years. This is because in the Gregorian calendar, a leap year occurs every four years. Therefore, "1461" signifies the total number of days in four years.
## Brief change log
<!--
Clearly describe the changes made in modules, classes, methods, etc.
-->
- Modify the Chinese characters to "1461".
## How was this patch tested?
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] Run test locally before making a pull request
## Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
--
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-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HotFix] Fix the Chinese characters in the code to the number '1461' [amoro]
Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on code in PR #2784:
URL: https://github.com/apache/amoro/pull/2784#discussion_r1578899610
##########
amoro-mixed-format/amoro-mixed-format-flink/amoro-mixed-format-flink-common/src/main/java/org/apache/amoro/flink/util/DateTimeUtils.java:
##########
@@ -958,8 +958,8 @@ private static int julianExtract(TimeUnitRange range, int julian) {
int j = julian + 32044;
int g = j / 146097;
int dg = j % 146097;
- int c = (dg / '躬' + 1) * 3 / 4;
- int dc = dg - c * '躬';
+ int c = (dg / 1461 + 1) * 3 / 4;
Review Comment:
I found it in the source file of the flink project as `36524`, not `1461`. Can you help confirm it again?
--
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-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix] Fix the Chinese characters in the code [amoro]
Posted by "jiamin13579 (via GitHub)" <gi...@apache.org>.
jiamin13579 commented on code in PR #2784:
URL: https://github.com/apache/amoro/pull/2784#discussion_r1578947198
##########
amoro-mixed-format/amoro-mixed-format-flink/amoro-mixed-format-flink-common/src/main/java/org/apache/amoro/flink/util/DateTimeUtils.java:
##########
@@ -958,8 +958,8 @@ private static int julianExtract(TimeUnitRange range, int julian) {
int j = julian + 32044;
int g = j / 146097;
int dg = j % 146097;
- int c = (dg / '躬' + 1) * 3 / 4;
- int dc = dg - c * '躬';
+ int c = (dg / 1461 + 1) * 3 / 4;
Review Comment:
Thanks, I checked the flink code and it also has Chinese characters. But when I print the '躬' char and convert it to int, it is indeed 36524.
--
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-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix] Fix the Chinese characters in the code [amoro]
Posted by "tcodehuber (via GitHub)" <gi...@apache.org>.
tcodehuber merged PR #2784:
URL: https://github.com/apache/amoro/pull/2784
--
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-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org