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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to