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 B6DD5181A4 for ; Wed, 30 Sep 2015 18:41:10 +0000 (UTC) Received: (qmail 2519 invoked by uid 500); 30 Sep 2015 18:41:04 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 2496 invoked by uid 500); 30 Sep 2015 18:41:04 -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 2483 invoked by uid 99); 30 Sep 2015 18:41:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Sep 2015 18:41:04 +0000 Date: Wed, 30 Sep 2015 18:41:04 +0000 (UTC) From: "Jason Dere (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-10178) DateWritable incorrectly calculates daysSinceEpoch for negative Unix time MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-10178?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Dere updated HIVE-10178: ------------------------------ Attachment: HIVE-10178.03-branch-1.0.patch Attaching patch for branch-1.0 based on patch v3, with the following change= s: - DateWritable.dateToDays() needs to be changed to use the millisToDays() m= ethod that is fixed in the patch. - Some test files in the patch do not yet exist in branch-1.0 (Hive on Spar= k, TestGenericUDFLastDay) qfile test output needs to be updated: * vector_between_in.q.out looks different from master because branch-1.0 do= es not have HIVE-3454 > DateWritable incorrectly calculates daysSinceEpoch for negative Unix time > ------------------------------------------------------------------------- > > Key: HIVE-10178 > URL: https://issues.apache.org/jira/browse/HIVE-10178 > Project: Hive > Issue Type: Bug > Components: Types > Reporter: Alexander Pivovarov > Assignee: Alexander Pivovarov > Fix For: 1.2.0 > > Attachments: HIVE-10178.01.patch, HIVE-10178.02.patch, HIVE-10178= .03-branch-1.0.patch, HIVE-10178.03.patch > > > For example: > {code} > select cast(cast('1966-01-01 00:00:01' as timestamp) as date); > 1966-01-02 > {code} > Another example: > {code} > select last_day(cast('1966-01-31 00:00:01' as timestamp)); > OK > 1966-02-28 > {code} > more details: > Date: 1966-01-01 00:00:01 > unix time UTC: -126230399 > daysSinceEpoch=3D=E2=88=92126230399000 / 86400000 =3D -1460.999988 > int daysSinceEpoch =3D -1460 > DateWritable having daysSinceEpoch=3D-1460 is 1966-01-02 > daysSinceEpoch should be -1461 instead (1966-01-01) -- This message was sent by Atlassian JIRA (v6.3.4#6332)