Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BD486200D31 for ; Sat, 21 Oct 2017 00:39:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BBD7A160BED; Fri, 20 Oct 2017 22:39:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 137C9160BCB for ; Sat, 21 Oct 2017 00:38:59 +0200 (CEST) Received: (qmail 40906 invoked by uid 500); 20 Oct 2017 22:38:59 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 40894 invoked by uid 99); 20 Oct 2017 22:38:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Oct 2017 22:38:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3394A18079F for ; Fri, 20 Oct 2017 22:38:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.362 X-Spam-Level: ** X-Spam-Status: No, score=2.362 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 7lBUQWpGIXTK for ; Fri, 20 Oct 2017 22:38:56 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 335475FB4E for ; Fri, 20 Oct 2017 22:38:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v9KMcs2r012966; Fri, 20 Oct 2017 22:38:54 GMT Message-Id: <201710202238.v9KMcs2r012966@ip-10-146-233-104.ec2.internal> X-Gerrit-PatchSet: 7 Date: Fri, 20 Oct 2017 22:38:54 +0000 From: "Impala Public Jenkins (Code Review)" To: Csaba Ringhofer , impala-cr@cloudera.com, reviews@impala.incubator.apache.org X-Gerrit-MessageType: merged Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5668=3A_Fix_cast=28X_as_timestamp=29_for_negative_subsecond_Decimals=0A?= X-Gerrit-Change-Id: I8216f4c0f100c1bd68891cd6048236bfe4c205f0 X-Gerrit-Change-Number: 8051 X-Gerrit-ChangeURL: X-Gerrit-Commit: 78776e9b5f03d122dbc6ddda81aec6e292f75ab4 In-Reply-To: References: Reply-To: impala-cr@cloudera.com, csringhofer@cloudera.com, reviews@impala.incubator.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.14.2 Content-Type: multipart/alternative; boundary="OxfPcOa1W88="; charset=UTF-8 archived-at: Fri, 20 Oct 2017 22:39:00 -0000 --OxfPcOa1W88= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Impala Public Jenkins has submitted this change and it was merged=2E ( http= ://gerrit=2Ecloudera=2Eorg:8080/8051 ) Change subject: IMPALA-5668: Fix ca= st(X as timestamp) for negative subsecond Decimals =2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E IMPALA-5668: Fix cast(X as timestamp)= for negative subsecond Decimals The timestamp conversion from negative fr= actional Decimal types (interpreted as unix timestamp) was wrong - the whol= e part was rounded toward zero, and fractional part was being added instead= of being subtracted=2E This is fixed by subtracting the fractional part in= case of negative decimals=2E Example for the wrong behaviour: +----------= ---------------------------------------+ | cast(cast(-0=2E1 as decimal(18,1= 0)) as timestamp) | +-------------------------------------------------+ | 1= 970-01-01 00:00:00=2E100000000 | +-----------------------= --------------------------+ while casting to double works correctly: +-----= ------------------------------------+ | cast(cast(-0=2E1 as double) as time= stamp) | +-----------------------------------------+ | 1969-12-31 23:59:59= =2E900000000 | +-----------------------------------------+ Chang= e-Id: I8216f4c0f100c1bd68891cd6048236bfe4c205f0 Reviewed-on: http://gerrit= =2Ecloudera=2Eorg:8080/8051 Reviewed-by: Tim Armstrong Tested-by: Impala Public Jenkins --- M be/src/exprs/decimal-operato= rs-ir=2Ecc M be/src/exprs/decimal-operators=2Eh M be/src/exprs/expr-test=2E= cc M be/src/runtime/decimal-value=2Eh M be/src/runtime/timestamp-value=2Eh = 5 files changed, 45 insertions(+), 37 deletions(-) Approvals: Tim Armstr= ong: Looks good to me, approved Impala Public Jenkins: Verified -- To v= iew, visit http://gerrit=2Ecloudera=2Eorg:8080/8051 To unsubscribe, visit h= ttp://gerrit=2Ecloudera=2Eorg:8080/settings Gerrit-Project: Impala-ASF Ger= rit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8216f4c0f1= 00c1bd68891cd6048236bfe4c205f0 Gerrit-Change-Number: 8051 Gerrit-PatchSet: = 7 Gerrit-Owner: Csaba Ringhofer Gerrit-Reviewe= r: Csaba Ringhofer Gerrit-Reviewer: Impala Pub= lic Jenkins Gerrit-Reviewer: Lars Volker Gerrit-Reviewe= r: Tim Armstrong --OxfPcOa1W88=--