You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/04 09:15:34 UTC

[GitHub] [doris] Gabriel39 commented on a diff in pull request #10586: [enhancement] speed up week_of_year by pre_calc table

Gabriel39 commented on code in PR #10586:
URL: https://github.com/apache/doris/pull/10586#discussion_r912798485


##########
be/src/vec/runtime/vdatetime_value.cpp:
##########
@@ -837,6 +837,9 @@ bool VecDateTimeValue::to_format_string(const char* format, int len, char* to) c
 }
 
 uint8_t VecDateTimeValue::calc_week(const VecDateTimeValue& value, uint8_t mode, uint32_t* year) {
+    if (value._year >= 1949 && value._year < 2030) {
+        return week_of_year_table[value._year - 1950][value._month][value._day];

Review Comment:
   `mode` also needs to be considered



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

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


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