vagetablechicken opened a new issue #3829:
URL: https://github.com/apache/incubator-doris/issues/3829


   **Describe the bug**
   
   In UT `DynamicPartitionUtilTest`, we set calendar timezone by 
`TimeUtils.getDefaultTimeZone()`. 
   
https://github.com/apache/incubator-doris/blob/2ce2cf78acc298a094771d1b6df602aeddb3e8d1/fe/src/test/java/org/apache/doris/common/util/DynamicPartitionUtilTest.java#L56-L62
   But we parse `calendar.getTime()`. It's a `Date`, **Date has no time zone**. 
So the Date obj is back to UTC timezone.
   
https://github.com/apache/incubator-doris/blob/2ce2cf78acc298a094771d1b6df602aeddb3e8d1/fe/src/main/java/org/apache/doris/common/util/DynamicPartitionUtil.java#L429-L435
   
   To solve it, SimpleDateFormat could set the same timezone with calendar. We 
shouldn't relay on the current timezone of system.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   1. set system timezone to other
   2. run fe ut DynamicPartitionUtilTest
   


----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to