From commits-return-9066-archive-asf-public=cust-asf.ponee.io@hudi.apache.org Tue Jan 7 03:23:10 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A7FC518067C for ; Tue, 7 Jan 2020 04:23:10 +0100 (CET) Received: (qmail 64989 invoked by uid 500); 7 Jan 2020 03:23:09 -0000 Mailing-List: contact commits-help@hudi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hudi.apache.org Delivered-To: mailing list commits@hudi.apache.org Received: (qmail 64970 invoked by uid 99); 7 Jan 2020 03:23:08 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jan 2020 03:23:08 +0000 From: GitBox To: commits@hudi.apache.org Subject: [GitHub] [incubator-hudi] sev7e0 commented on a change in pull request #1188: [HUDI-502] provide a custom time zone definition for TimestampBasedKeyGenerator Message-ID: <157836738881.2314.3673270547839798307.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Tue, 07 Jan 2020 03:23:08 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit sev7e0 commented on a change in pull request #1188: [HUDI-502] provide a custom time zone definition for TimestampBasedKeyGenerator URL: https://github.com/apache/incubator-hudi/pull/1188#discussion_r363577501 ########## File path: hudi-utilities/src/main/java/org/apache/hudi/utilities/keygen/TimestampBasedKeyGenerator.java ########## @@ -70,20 +74,22 @@ public TimestampBasedKeyGenerator(TypedProperties config) { Arrays.asList(Config.TIMESTAMP_TYPE_FIELD_PROP, Config.TIMESTAMP_OUTPUT_DATE_FORMAT_PROP)); this.timestampType = TimestampType.valueOf(config.getString(Config.TIMESTAMP_TYPE_FIELD_PROP)); this.outputDateFormat = config.getString(Config.TIMESTAMP_OUTPUT_DATE_FORMAT_PROP); + this.timeZone = TimeZone.getTimeZone(config.getString(Config.TIMESTAMP_TIMEZONE_FORMAT_PROP, "GMT")); if (timestampType == TimestampType.DATE_STRING || timestampType == TimestampType.MIXED) { DataSourceUtils.checkRequiredProperties(config, Collections.singletonList(Config.TIMESTAMP_INPUT_DATE_FORMAT_PROP)); this.inputDateFormat = new SimpleDateFormat(config.getString(Config.TIMESTAMP_INPUT_DATE_FORMAT_PROP)); - this.inputDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + this.timeZone = TimeZone.getTimeZone(config.getString(Config.TIMESTAMP_TIMEZONE_FORMAT_PROP, "GMT")); Review comment: `timeZone` has been init. I don't think we need to do this again. ---------------------------------------------------------------- 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