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/06/08 10:13:02 UTC

[GitHub] [incubator-doris] WingsGo opened a new pull request #3799: [Dynamic Partition] Use ZonedDateTime to support set timezone

WingsGo opened a new pull request #3799:
URL: https://github.com/apache/incubator-doris/pull/3799


   This CL mainly support timezone in dynamic partition:
   1. use new Java Time API to replace Calender.
   2. support set time zone in dynamic partition parameters.


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


[GitHub] [incubator-doris] morningman merged pull request #3799: [Dynamic Partition] Use ZonedDateTime to support set timezone

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #3799:
URL: https://github.com/apache/incubator-doris/pull/3799


   


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


[GitHub] [incubator-doris] morningman commented on a change in pull request #3799: [Dynamic Partition] Use ZonedDateTime to support set timezone

Posted by GitBox <gi...@apache.org>.
morningman commented on a change in pull request #3799:
URL: https://github.com/apache/incubator-doris/pull/3799#discussion_r437463262



##########
File path: fe/src/main/java/org/apache/doris/catalog/DynamicPartitionProperty.java
##########
@@ -46,15 +48,14 @@
     private int buckets;
     private StartOfDate startOfWeek;
     private StartOfDate startOfMonth;
-    // TODO: support setting timezone.
     private TimeZone tz = TimeUtils.getDefaultTimeZone();
 
-
     public DynamicPartitionProperty(Map<String, String> properties) {
         if (properties != null && !properties.isEmpty()) {
             this.exist = true;
             this.enable = Boolean.parseBoolean(properties.get(ENABLE));
             this.timeUnit = properties.get(TIME_UNIT);
+            this.tz = TimeZone.getTimeZone(properties.getOrDefault(TIME_ZONE, ZoneId.systemDefault().toString()));

Review comment:
       Better move the time related functions to TimeUtils class

##########
File path: fe/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
##########
@@ -148,11 +151,25 @@ private static void checkStartDayOfWeek(String val) throws DdlException {
         }
     }
 
+    private static void checkTimeZone(String val) throws DdlException {

Review comment:
       Why not using `TimeUtils.checkTimeZoneValidAndStandardize()`?

##########
File path: docs/en/administrator-guide/dynamic-partition.md
##########
@@ -89,6 +89,10 @@ The rules of dynamic partition are prefixed with `dynamic_partition.`:
 
     When specified as `MONTH`, the suffix format of the dynamically created partition name is `yyyyMM`, for example, `202003`.
 
+* `dynamic_partition.time_zone`
+
+    The time zone of the dynamic partition, if not filled in, defaults to the time zone of the current machine's system, such as `Asia/Shanghai`, if you want to know the supported TimeZone, you can run `TimeZone.getAvailableIDs()` in Java.

Review comment:
       How about finding timezone here?
   https://en.wikipedia.org/wiki/List_of_tz_database_time_zones




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


[GitHub] [incubator-doris] WingsGo commented on a change in pull request #3799: [Dynamic Partition] Use ZonedDateTime to support set timezone

Posted by GitBox <gi...@apache.org>.
WingsGo commented on a change in pull request #3799:
URL: https://github.com/apache/incubator-doris/pull/3799#discussion_r437503604



##########
File path: fe/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java
##########
@@ -148,11 +151,25 @@ private static void checkStartDayOfWeek(String val) throws DdlException {
         }
     }
 
+    private static void checkTimeZone(String val) throws DdlException {

Review comment:
       In fact, i don't konw the function...

##########
File path: docs/en/administrator-guide/dynamic-partition.md
##########
@@ -89,6 +89,10 @@ The rules of dynamic partition are prefixed with `dynamic_partition.`:
 
     When specified as `MONTH`, the suffix format of the dynamically created partition name is `yyyyMM`, for example, `202003`.
 
+* `dynamic_partition.time_zone`
+
+    The time zone of the dynamic partition, if not filled in, defaults to the time zone of the current machine's system, such as `Asia/Shanghai`, if you want to know the supported TimeZone, you can run `TimeZone.getAvailableIDs()` in Java.

Review comment:
       done

##########
File path: fe/src/main/java/org/apache/doris/catalog/DynamicPartitionProperty.java
##########
@@ -46,15 +48,14 @@
     private int buckets;
     private StartOfDate startOfWeek;
     private StartOfDate startOfMonth;
-    // TODO: support setting timezone.
     private TimeZone tz = TimeUtils.getDefaultTimeZone();
 
-
     public DynamicPartitionProperty(Map<String, String> properties) {
         if (properties != null && !properties.isEmpty()) {
             this.exist = true;
             this.enable = Boolean.parseBoolean(properties.get(ENABLE));
             this.timeUnit = properties.get(TIME_UNIT);
+            this.tz = TimeZone.getTimeZone(properties.getOrDefault(TIME_ZONE, ZoneId.systemDefault().toString()));

Review comment:
       done




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