apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.77k stars 3.29k forks source link

Please support timezone as more as possible #3950

Open lxxstc opened 4 years ago

lxxstc commented 4 years ago

The time zone of my server is UTC. so, It will throw an exception like "Unknown or incorrect time zone: 'UTC'", when I perform some DDL. Please support the timezone as more as possible, at least including UTC. Below is git diff between my workspace and branch master

index 21612bfc..6dcfe0ce 100644
--- a/fe/src/main/java/org/apache/doris/common/util/TimeUtils.java
+++ b/fe/src/main/java/org/apache/doris/common/util/TimeUtils.java
@@ -256,7 +256,7 @@ public class TimeUtils {
             Matcher matcher = TIMEZONE_OFFSET_FORMAT_REG.matcher(value);
             // it supports offset and region timezone type, "CST" use here is compatibility purposes.
             boolean match = matcher.matches();
-            if (!value.contains("/") && !value.equals("CST") && !match) {
+            if (!value.contains("/") && !value.equals("UTC") && !value.equals("CST") && !match) {
                 ErrorReport.reportDdlException(ErrorCode.ERR_UNKNOWN_TIME_ZONE, value);
             }
             if (match) {
lxxstc commented 4 years ago

I have checked the output of timedatectl list-timezones, only UTC has been lost.

lxxstc commented 4 years ago

another way to fix this issue with the command below

# timedatectl set-timezone Atlantic/Reykjavik

replace the time zone UTC with time zone Atlantic/Reykjavik

morningman commented 4 years ago

Could you submit a PR to add UTC for us?