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 ED39B200CC8 for ; Fri, 30 Jun 2017 04:37:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EAA0D160BFE; Fri, 30 Jun 2017 02:37:19 +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 60BFF160BF7 for ; Fri, 30 Jun 2017 04:37:19 +0200 (CEST) Received: (qmail 71039 invoked by uid 500); 30 Jun 2017 02:37:18 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 71003 invoked by uid 99); 30 Jun 2017 02:37:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Jun 2017 02:37:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 82AC5E041D; Fri, 30 Jun 2017 02:37:16 +0000 (UTC) From: paul-rogers To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #863: DRILL-4970: Prevent changing the negative value of ... Content-Type: text/plain Message-Id: <20170630023717.82AC5E041D@git1-us-west.apache.org> Date: Fri, 30 Jun 2017 02:37:16 +0000 (UTC) archived-at: Fri, 30 Jun 2017 02:37:20 -0000 Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/863#discussion_r124953868 --- Diff: exec/java-exec/src/test/java/org/apache/drill/exec/fn/impl/TestCastFunctions.java --- @@ -78,4 +81,71 @@ public void testToDateForTimeStamp() throws Exception { .build() .run(); } + + @Test // DRILL-4970 + public void testCastNegativeFloatToInt() throws Exception { + try { + test("create table dfs_test.tmp.table_with_float as\n" + --- End diff -- A full test would handle all conditions: * 0 * +/- 0.4 * +/- 0.5 * INTEGER.MAX_VALUE as double * INTEGER.MAX_VALUE + 0.4 as double * INTEGER.MAX_VALUE + 0.5 as double * INTEGER.MIN_VALUE as double * INTEGER.MIN_VALUE - 0.4 as double * INTEGER.MIN_VALUE - 0.5 as double * DOUBLE.MAX_VALUE * DOUBLE.MIN_VALUE --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---