From issues-return-47860-apmail-hive-issues-archive=hive.apache.org@hive.apache.org Mon Jul 25 03:10:21 2016 Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66B2819BCB for ; Mon, 25 Jul 2016 03:10:21 +0000 (UTC) Received: (qmail 30506 invoked by uid 500); 25 Jul 2016 03:10:21 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 30482 invoked by uid 500); 25 Jul 2016 03:10:20 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 30468 invoked by uid 99); 25 Jul 2016 03:10:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jul 2016 03:10:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 967A42C0278 for ; Mon, 25 Jul 2016 03:10:20 +0000 (UTC) Date: Mon, 25 Jul 2016 03:10:20 +0000 (UTC) From: "Ryan Blue (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-14305) To/From UTC timestamp may return incorrect result because of DST MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-14305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391280#comment-15391280 ] Ryan Blue commented on HIVE-14305: ---------------------------------- To be clear, I'm saying that the correct solution is to call Timezone.setDefault to set the zone used by Timestamp to UTC. This should never be changed once it is set to UTC. But, to implement the SQL session time zone's default you would need to know what the original zone was. I'm not sure what you mean by "whole query"; I'm not aware of some setting for just a query. There's the SQL session time zone, are you talking about that? > To/From UTC timestamp may return incorrect result because of DST > ---------------------------------------------------------------- > > Key: HIVE-14305 > URL: https://issues.apache.org/jira/browse/HIVE-14305 > Project: Hive > Issue Type: Sub-task > Reporter: Rui Li > Assignee: Rui Li > > If the machine's local timezone involves DST, the UDFs return incorrect results. > For example: > {code} > select to_utc_timestamp('2005-04-03 02:01:00','UTC'); > {code} > returns {{2005-04-03 03:01:00}}. Correct result should be {{2005-04-03 02:01:00}}. > {code} > select to_utc_timestamp('2005-04-03 10:01:00','Asia/Shanghai'); > {code} > returns {{2005-04-03 03:01:00}}. Correct result should be {{2005-04-03 02:01:00}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)