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 2020/04/10 14:27:30 UTC

[GitHub] [incubator-doris] HangyuanLiu opened a new pull request #3300: Use Google/CCTZ to replace boost at timezone function

HangyuanLiu opened a new pull request #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300
 
 
   For #3263 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] HangyuanLiu commented on issue #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
HangyuanLiu commented on issue #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300#issuecomment-613994457
 
 
   > UT is failed
   
   Ready for review @morningman 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] HangyuanLiu commented on issue #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
HangyuanLiu commented on issue #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300#issuecomment-612349756
 
 
   > We have to update the thirdparty dependency of our CI environment, or the compilation will be failed.
   > I will update them next week.
   
   OK

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] morningman commented on issue #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300#issuecomment-613473584
 
 
   UT is failed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] morningman commented on a change in pull request #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300#discussion_r410857512
 
 

 ##########
 File path: be/src/runtime/datetime_value.h
 ##########
 @@ -494,6 +498,33 @@ class DateTimeValue {
         return _neg ? -tmp : tmp;
     }
 
+    bool find_cctz_time_zone(const std::string& timezone, cctz::time_zone& ctz) const {
+        re2::StringPiece value;
+        if (time_zone_offset_format_reg.Match(timezone, 0, timezone.size(), RE2::UNANCHORED, &value, 1)) {
+            bool postive = value[0] != '-';
+
+            //Regular expression guarantees hour and minute mush be int 
+            int hour = std::stoi(value.substr(1, 2).as_string());
+            int minute = std::stoi(value.substr(4, 2).as_string());
+
+            // timezone offsets around the world extended from -12:00 to +14:00
+            if (!postive && hour > 12) {
+                return false;
+            } else if (postive && hour > 14) {
+                return false;
+            }
+            int offset = hour * 60 * 60 + minute * 60;
+            offset *= postive ? 1 : -1;
+            ctz = cctz::fixed_time_zone(cctz::seconds(offset));
+            return true;
+        } else if (timezone == "CST"){
+            // Supports offset and region timezone type, "CST" use here is compatibility purposes.
+            ctz = cctz::fixed_time_zone(cctz::seconds(8 * 60 * 60));
 
 Review comment:
   Missing return value

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] morningman commented on issue #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #3300: Use Google/CCTZ to replace boost at timezone function
URL: https://github.com/apache/incubator-doris/pull/3300#issuecomment-612068757
 
 
   We have to update the thirdparty dependency of our CI environment, or the compilation will be failed.
   I will update them next week.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-doris] HangyuanLiu commented on issue #3300: Use Google/CCTZ to replace boost at timezone function

Posted by GitBox <gi...@apache.org>.
HangyuanLiu commented on issue #3300:
URL: https://github.com/apache/incubator-doris/pull/3300#issuecomment-616626843


   > LGTM, plz wait the result of our test.
   
   OK


----------------------------------------------------------------
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.

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