You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/08/05 13:03:28 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #1587: Set timezone variable in fe

imay commented on a change in pull request #1587: Set timezone variable in fe
URL: https://github.com/apache/incubator-doris/pull/1587#discussion_r310593135
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/qe/VariableMgr.java
 ##########
 @@ -203,6 +209,33 @@ private static void checkUpdate(SetVar setVar, int flag) throws DdlException {
         }
     }
 
+    // Check if the time zone_value is valid
+    private static void checkTimeZoneValid(SetVar setVar) throws DdlException {
+        if (setVar.getValue() != null) {
+            String value = setVar.getValue().getStringValue();
+            try {
+                Pattern p = Pattern.compile("^[+-]{1}\\d{2}\\:\\d{2}$");
+                Matcher m = p.matcher(value);
+                if (!value.contains("/") && !value.equals("CST") && !m.matches()) {
+                    ErrorReport.reportDdlException(ErrorCode.ERR_UNKNOWN_TIME_ZONE, setVar.getValue().getStringValue());
+                }
+                if (m.matches()) {
 
 Review comment:
   Can you add some comments for this function to let people known what it want to do?

----------------------------------------------------------------
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: dev-unsubscribe@doris.apache.org
For additional commands, e-mail: dev-help@doris.apache.org